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?

It would help if you said what application you are working on

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.

Beyond me I’m afraid.
Be patient, someone more experienced may see this. Sorry:)

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.

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

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)

I just installed VUE. And it worked out. Both ways.

OpenSuse 11.3 64 bits.