Thread: Jar Help

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    3
    Rep Power
    0

    Jar Help


    Hello everyone. I'm relatively new to Java and have written a couple of programs, but there's only one I'm trying to get deployed. When I make the Jar, it works for me, as well as on my other computer, but they each have the JDK installed on them, so I don't know if that matters. Once I have the Jar made, I use JSmooth to turn it into an executable, which also works fine for me. The error, however, is that neither the Jar nor the executable will work for anyone else, and I was wondering if anyone had any pointers on how I would go about that?

    Thank you.

    edit: Sorry, the error that pops up when others try to run it says "Could not find main class: FILENAME.class"

    (would rather not divulge the name of it just yet )
  2. #2
  3. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,716
    Rep Power
    348
    Could not find main class: FILENAME.class"
    The name in the message looks like a filename not a classname.
    A classname would not end with .class.
    Try removing the .class from the name of the class.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    3
    Rep Power
    0
    Originally Posted by NormR
    The name in the message looks like a filename not a classname.
    A classname would not end with .class.
    Try removing the .class from the name of the class.
    See, that's the thing. In the manifest file, all I put is:

    Main-Class: FileName

    (Return included)

    So I really don't understand what's going on. Anyone else got a suggestion?
  6. #4
  7. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,716
    Rep Power
    348
    Try this to get better error messages:
    Open a command prompt window, change to the folder with the jar file and enter:
    java -jar THEJARFILENAME.jar

    copy the full contents of the command prompt window and paste it here.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    3
    Rep Power
    0
    Originally Posted by NormR
    Try this to get better error messages:
    Open a command prompt window, change to the folder with the jar file and enter:
    java -jar THEJARFILENAME.jar

    copy the full contents of the command prompt window and paste it here.
    I understand what you're saying and I appreciate the help, but I don't think you understand. The Jar works fine for me, on both of my computers. It's others that it doesn't work for. It runs flawlessly on mine, so the Jar isn't really the issue; the issue I think is something missing, but I'm trying to figure out what.
  10. #6
  11. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,716
    Rep Power
    348
    It's others that it doesn't work for.
    Do what I suggested on the computer where there is a problem.
    Doing it where there isn't a problem won't show you what the problem is on some other computer.

IMN logo majestic logo threadwatch logo seochat tools logo