aspose file tools*
The moose likes Beginning Java and the fly likes Jar file doesn't work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Jar file doesn Watch "Jar file doesn New topic
Author

Jar file doesn't work

Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
Hello. I have created a jar file and put a shortcut on my desktop so I can just click on it and run it. However, when I double click the shortcut, it acts like it's going to work, but then the hourglass goes away and nothing ever comes up. No errors either. Can someone please tell me what's going on??
Thanks!
Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
Okay, I changed javaw.exe to java.exe, and briefly got a DOS prompt that told me I had a null pointer exception. Which brings up another question. I am getting the NullPointerException on an Image. Why can't it find the image? It's in the jar file along with everything else, so why can't it see it??
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9052
    
  12
If you run the jar file from the command line, the errors that are generated won't disappear. After you have it working, you can change it to a shortcut.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
Thanks for the reply. The application runs just fine from the command line. I just can't seem to get it to run from a jar file. It can't seem to find the image in the jar file, but it's in there. Is there something I missed?
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9052
    
  12
Did you run

java -jar MyApp.jar

from the command line?
Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
I just realized what you meant after I posted the last time. Sorry. When I try to run the jar file from the command line, It says it failed to load the main-class from the manifest file.
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9052
    
  12
Do you have a manifest.mf file in your jar?
[ February 14, 2003: Message edited by: Marilyn de Queiroz ]
Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
Yup. Any other ideas?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jar file doesn't work