Results 1 to 8 of 8

Thread: running .jar

  1. #1

    Default running .jar

    Just installed linux, have had it in the past but not for some time.

    I was looking to run a .jar file but for life of me it can't. I try and associate it as the guides all say but can't find what jave runtime files they are talking about.

    I do have java installed, it has a folder in usr/java but I just don't know what i am supposed to be telling the .jar files to use?

  2. #2
    Join Date
    Jun 2008
    Location
    The English Lake District. UK - GMT/BST
    Posts
    36,733
    Blog Entries
    20

    Default Re: running .jar

    It would help if you said what application you are working on
    Leap 15.1_KDE
    My Articles Was I any help? If yes: Click the star below

  3. #3

    Default Re: running .jar

    Just a random .jar. I have tried several. latest one I just did a build off netbeans and then went to the .jar file and I just cant get it to run.

    Did a build with no code additions, just the first basic window thats supposed to pop up.

    name of file is DesktopApplication1.jar.

    Java files I looked into are:/usr/java/jre1.6.0_14.

    Just cant find anything in there to open it.

  4. #4
    Join Date
    Jun 2008
    Location
    The English Lake District. UK - GMT/BST
    Posts
    36,733
    Blog Entries
    20

    Default Re: running .jar

    Beyond me I'm afraid.
    Be patient, someone more experienced may see this. Sorry
    Leap 15.1_KDE
    My Articles Was I any help? If yes: Click the star below

  5. #5
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: running .jar

    To run a .jar file from the CLI, do:

    java -jar foo.jar

    If your CLASSPATH is not set correctly you either have to fix that or use -cp to override. You may also have to specify the entry point (main program). But that should get you started. Hopefully you can figure out the association from that.

    If you are developing in Java, you might want to look into IDEs like Eclipse.

  6. #6
    brassy NNTP User

    Default Re: running .jar

    what happens if you type into a terminal (and then press enter)

    java -jar /home/[you]/[rest of path]/DesktopApplication1.jar

    do you get a error message, or what?

    see: man java

    --
    brassy

  7. #7
    Join Date
    Jan 2009
    Location
    Nrnberg
    Posts
    19

    Default Re: running .jar

    If your lucky then your system is set up so that a simple double click works.
    One solution is right click -> properties -> click on the icon next to type and then set java -jar as the default program to use to launch that file.
    Alternately just type java -jar /path/to/jar/file into a terminal (that way you'll see all error messages the program prints and it might tell you if for example the classpath is not set correctly)

  8. #8
    Join Date
    Oct 2009
    Location
    Berlin.
    Posts
    90

    Default Re: running .jar

    Quote Originally Posted by alerich View Post
    One solution is right click -> properties -> click on the icon next to type and then set java -jar as the default program to use to launch that file.
    Alternately just type java -jar /path/to/jar/file into a terminal
    I just installed VUE. And it worked out. Both ways.

    OpenSuse 11.3 64 bits.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •