This discussion is archived
6 Replies Latest reply: Dec 24, 2009 11:31 AM by 843789 RSS

opening a .jar file.

843789 Newbie
Currently Being Moderated
Hello all!

I've ran into a little trouble opening a .jar file open.

it is in a folder in my desktop, called "gcode for reprap"

The file name is "repgcode-0.3.jar"

I have downloaded jdk 6 update 17 @ http://java.sun.com/javase/downloads/widget/jdk6.jsp

and installed it, into "C:\Program Files\Java\jdk1.6.0_17\bin"

My PATH (control panel>systems>advanced>environmental variables> path = C:\Program Files\Java\jdk1.6.0_17\bin) seems to be set up correctly.

I input the command, "java -jar repgcode-0.3.jar" into my cmd line.

The return message reads, "unable to access jarfile repgcode-0.3.jar"

Any help to get this kink sorted out would be much appreciated.

Thanks in advance!
  • 1. Re: opening a .jar file.
    843789 Newbie
    Currently Being Moderated
    1) The CLASSPATH environment variable is ignored when you use java -jar
    2) The jar file used with java -jar must be specified though an absolute or relative path. No searching of classpaths is done.
  • 2. Re: opening a .jar file.
    843789 Newbie
    Currently Being Moderated
    How do I specify an absolute or relative path?

    So frustrated. I'll paypal anybody $20 to get this this .jar file running on my computer. e-mail me at andrewjbae@hotmail.com

    Edited by: brickbatbae on Dec 23, 2009 11:50 PM

    Edited by: brickbatbae on Dec 24, 2009 12:19 AM
  • 3. Re: opening a .jar file.
    843789 Newbie
    Currently Being Moderated
    It will be something like
    java -jar "\Documents and Settings\brickbatbae\Desktop\gcode for reprap\repgcode-0.3.jar"
    There really should have been usage instructions with the .jar file. You can't really just throw these things at a Java runtime (once you've figured out how to throw them) and hope for the best.
  • 4. Re: opening a .jar file.
    843789 Newbie
    Currently Being Moderated
    Yes! I as able to access the .jar file! but...I recieved an error message!!!

    After running



    C:\Documents and Settings\Andrew Bae>java -jar "C:\Documents and Settings\Andrew
    Bae\Desktop\gcode for reprap/repgcode-0.3.jar"

    I recieve this error message:

    Exception in thread "G-code for RepRap" java.lang.NoClassDefFoundError: gnu/io/C
    ommPortIdentifier
    at com.chrismeighan.repgcode.GCodeCommunicator.<init>(GCodeCommunicator.
    java:43)
    at com.chrismeighan.repgcode.Main.initialiseComms(Main.java:168)
    at com.chrismeighan.repgcode.Main.loadPreferences(Main.java:638)
    at com.chrismeighan.repgcode.Main.<init>(Main.java:136)
    at com.chrismeighan.repgcode.Main.main(Main.java:123)
    Caused by: java.lang.ClassNotFoundException: gnu.io.CommPortIdentifier
    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)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    ... 5 more

    A buddy of mine said he just ran a batch file that came with the program. But when viewing the batch file in notepad, it's a simple,

    "java -jar %~dp0repgcode-0.3.jar"

    which obviously didn't work.

    This is really killing me. Any help would really prevent me from jumping off a bridge :)

    Thanks again, guys, who helped me out. one step at a time!

    Edited by: brickbatbae on Dec 24, 2009 1:43 AM
  • 5. Re: opening a .jar file.
    843789 Newbie
    Currently Being Moderated
    Looks to me like the manifest file does not define the class path attribute to include the jar file containing the jar containing the class gnu/io/CommPortIdentifier. What is the content of your manifest file?
  • 6. Re: opening a .jar file.
    843789 Newbie
    Currently Being Moderated
    If you have an archive manager like WinRAR, you can open the jar file, browse to the META-INF folder, and edit the manifest there. It should have a line like "Main-Class: gnu.io.CommPortIdentifier". Also hit enter and return to the beginning of the next line.
    brickbatbae wrote:
    Caused by: java.lang.ClassNotFoundException: gnu.io.CommPortIdentifier
    I find that interesting. It could mean that java cannot find the file that is supposed to be run, or that it doesn't exist.