How to run a JAR file on Command Prompt?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   xiaoling_dai
Posted On:   Saturday, May 11, 2002 09:59 PM

I've created a JAR file using the main class specified in the default runtime in Jbuilder5. I couldn't run it on Command Prompt. The command is java -jar jar-file main-class the error displayed as flollow: Exception in thread "main" java.util.zip.ZipException: The system cannot find the file specified at java.util.zip.ZipFile.open(Native Method) atjava.util.zip.ZipFile. ZipFile.java:110) at java.util.jar.JarFile. (JarFile.java:115) at java.util.jar.JarFile. (JarFile.java:57) Thanks. Xiaoling    More>>

I've created a JAR file using the main class specified in the default runtime in Jbuilder5. I couldn't run it on Command Prompt. The command is


java -jar jar-file main-class


the error displayed as flollow:


Exception in thread "main" java.util.zip.ZipException: The system cannot find the file specified

at java.util.zip.ZipFile.open(Native Method)

atjava.util.zip.ZipFile. ZipFile.java:110)

at java.util.jar.JarFile. (JarFile.java:115)

at java.util.jar.JarFile. (JarFile.java:57)


Thanks.

Xiaoling

   <<Less

Re: How to run a JAR file on Command Prompt?

Posted By:   Frederic_Fondement  
Posted On:   Tuesday, May 14, 2002 02:28 AM

Try to include your jar into the classpath like

java -classpath=jar-file main-class
About | Sitemap | Contact