Announcement

Collapse
No announcement yet.

How do I execute .jar files?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How do I execute .jar files?

    I unzipped a folder containing a complete java program with all the supporting files. When I click the .jar file that should run the program, it just opens in Ark. How do I execute this .jar?

    I installed Sun Java, but I haven't configured it as my primary Java VM yet. Would this make a difference? If so, step-by-step instructions on how to configure Sun Java as my Java VM would be appreciated.
    Currently Running Dapper 6.06 amd64 on:<br />Athalon 64 3000+<br />512Mb DDR400<br />ATi 9200SE<br />Maxtor DiamondMax 10 80Gb

    #2
    Re: How do I execute .jar files?

    The standard command to execute the someapp.jar program would be
    java -jar someapp.jar. That assumes java is configured correctly and in your PATH. To configure the Sun JVM look here

    http://ubuntuguide.org/wiki/Dapper#H...ozilla_Firefox

    Comment


      #3
      Re: How do I execute .jar files?

      And how would I make sure that Java is correctly added to my PATH? What is a PATH?
      Currently Running Dapper 6.06 amd64 on:<br />Athalon 64 3000+<br />512Mb DDR400<br />ATi 9200SE<br />Maxtor DiamondMax 10 80Gb

      Comment


        #4
        Re: How do I execute .jar files?

        the PATH environment variable is a list of directories. When you type an executable command, these are the directories that your system searches for to find that command. If you install something (like java) to a directory that isn't in your PATH the system won't find it. Don't get hung up on that for now, install Java according to the instructions and issue the java -jar command. If everything works then no problem. If there is a problem we can sort it out at that point.

        Comment


          #5
          Re: How do I execute .jar files?

          Is there any way of turn it an automatic process when i click the file?

          I mean I dont want to run the command on konsole, just click on it and it opens.
          Kubuntu 15.10 - Asus All-in-one (i3, 4GB ram)

          Comment


            #6
            Re: How do I execute .jar files?

            I don't know how you would add a file association to the jar to make it run the command in the java -jar configuration, but you can create a one line shell script (text file with .sh extension) which contains the command:

            "java -jar myapp.jar"

            Place it in the same dir as myapp.jar, make it executable (right click -> properties -> permissions tab: check box for "is executable" and click ok) and it should "just work" when you click on it (not the jar).

            Comment


              #7
              Re: How do I execute .jar files?

              Good suggestion, but i want a general solution for all jar files.
              Following what you said, it is necessary to create one script for each jar file and this is not practical =/
              Kubuntu 15.10 - Asus All-in-one (i3, 4GB ram)

              Comment


                #8
                Re: How do I execute .jar files?

                Does this help:
                http://www.linuxquestions.org/questi...e-click-97711/

                Edit: also:
                http://forums.sun.com/thread.jspa?th...54735&tstart=4
                Laptop: Lenovo Thinkpad R52, Kubuntu 9.04 (KDE)<br />Desktop: Lenovo Thinkcentre, Fedora 13 (Gnome)

                Comment


                  #9
                  Re: How do I execute .jar files?

                  The first link answered m question perfecty
                  Thank you!
                  Kubuntu 15.10 - Asus All-in-one (i3, 4GB ram)

                  Comment


                    #10
                    Re: How do I execute .jar files?

                    +1 to that. Cheers!

                    Comment

                    Working...
                    X