Question:
How to run a Java .Jar file?
Anonymous Person
2013-01-07 10:15:32 UTC
I have made a Java game made up of many class's and images so using eclipse I went through the steps of selecting project and destination etc and made a .Jar file but the problem is, when I double click the jar file whic is now on my desktop my game doesn't load, it loads when I run it on eclipse but not when I double click the .Jar file, is this supposed to happen?
Three answers:
?
2013-01-07 10:36:37 UTC
Open it with Java, it seems like you're a programmer so I don't know why you haven't tried this.



Right Click > Open With > Java Platform SE Binary



If you for some reason don't have java downloaded, to go http://java.com



I may have misunderstood your question though.
jplatt39
2013-01-07 11:29:04 UTC
The Wikipedia article has a good discussion of it:



"Executable JAR files



An executable Java program can be packaged in a JAR file, along with any libraries the program uses. Executable JAR files are distinguished by a 'extra field' on the first file with a hexadecimal field code of 0xCAFE.[4] In addition, the manifest must specify the "main" class, with an entry such as Main-Class: myPrograms.MyClass. On many operating systems, including Microsoft Windows, Solaris and most Linux distributions, these JAR files can be treated like any other executable file.[4] In any case, users can enter a command similar to "java -jar foo.jar".



Microsoft Windows users who prefer having Windows EXE files can use tools such as JSmooth, Launch4J, WinRun4J or Nullsoft Scriptable Install System to wrap JAR files into executables."



that "java -jar foo.jar" command line (create a shortcut edit the properties and that's where you would put it) should work on Windows with no problem.
anonymous
2014-07-21 21:01:24 UTC
Ehm..

Check here http://j.mp/1p3PBg3 if you want to get Winrar for free

To open compressed files (zip rar jar iso 7z cab uue gz....) you have to use WinRar. With WinRar you can easily decompress files and folders.

Bye


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...