Can't open a .JAR file

Soldato
Joined
12 Jan 2009
Posts
6,469
I have this .JAR file which is a tiny little program we use at work. Unfortunately the PC that had this software on had malfunctioned and so a replacement was installed. However after copying the software files when double clicking the ‘DesktopApplication1.JAR’ file nothing happens, the software doesn’t load.

Anyone know how to run .JAR files in a Windows environment? Windows 7 says it's en 'executable JAR file' so I presumed by double clicking on it it would open up. I can upload the software into my Dropbox if someone can help me out please, it's only 300kb in size.
 
Do you have JRE and/or JDK installed?

You could try running it from a command prompt.

java -jar nameoffile.jar
 
I get an error saying ''java' is not recognized as an internal or external command,
operable program or batch file.'

I have JRE installed
 
It's not on your path then, you'll have to locate the directory you installed it to and add that to the path or run it using it's full path file name, e.g.: "C:\program files\java\1.7.0\jre\bin\java" -jar nameoffile.jar
 
no luck I'm afraid:

C:\Program Files (x86)\Java\jre7>java -jar DesktopApplication1
'java' is not recognized as an internal or external command,
operable program or batch file.
 
no luck I'm afraid:

C:\Program Files (x86)\Java\jre7>java -jar DesktopApplication1
'java' is not recognized as an internal or external command,
operable program or batch file.

Are you sure that's the directory with java.exe in it? Normally it's in blah/jre/bin
 
OK tried again this morning and I get this:


C:\Windows\System32>java -jar "C:\Program Files\Java\jre7\DesktopApplication1.jar"

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: gnu/io/Co
mmPortIdentifier
at desktopapplication1.TwoWaySerialComm.connect(TwoWaySerialComm.java:33
)
at desktopapplication1.DesktopApplication1View.<init>(DesktopApplication
1View.java:48)
at desktopapplication1.DesktopApplication1.startup(DesktopApplication1.j
ava:19)
at org.jdesktop.application.Application$1.run(Application.java:171)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: gnu.io.CommPortIdentifier
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 18 more


EDIT: tried in the bin folder and I get the same error
 
At least you've got to the stage where the java executable is now running but there's still something not right - probably the classpath environment variable. You mention pc problems in the first post, are you now running this on a compltely different pc? Was any config carried over from the old machine?
 
Back
Top Bottom