Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Unable to execute executable jar file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Unable to execute executable jar file " Watch "Unable to execute executable jar file " New topic
Author

Unable to execute executable jar file

Amit Kr Kumar
Ranch Hand

Joined: Feb 08, 2002
Posts: 100
Hi Team
I am facing a very unusual problem. I have created an executable server jar file. I am able to run it using the java -jar server.jar from the same directory where server.jar file is lying.
However when i go to any other directory from prompt and execute java -jar server.jar it says :

Exception in thread "main" java.util.zip.ZipException: The system cannot find the file specified
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:110)
at java.util.jar.JarFile.<init>(JarFile.java:115)
at java.util.jar.JarFile.<init>(JarFile.java:57)
I have set the classpath as well in the prompt
using the command
set CLASSPATH=%CLASSPATH%;c:\server\server.jar;
Pls Help
Amit
Amit Kr Kumar
Ranch Hand

Joined: Feb 08, 2002
Posts: 100
Anybody Please Help
Amit
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Unable to execute executable jar file
 
Similar Threads
Junilu, Ian, Peter and others pls help
Executing jar file - Urgent (Max Help)
running a class in a jar ......
How to Execute jars
NX- About Launching the application