Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

executable jar - java.util.zip.ZipException

0 views
Skip to first unread message

o.k.

unread,
Nov 22, 2001, 5:01:06 PM11/22/01
to
I have a jar file containing MyApp - MyApp.jar
i've specified the Main-Class in the Manifest
i have MyApp.jar and MyApp_home on my classpath
java -jar MyApp_home\MyApp.jar runs fine, but i cannot run it without
specifying MyApp's full path .
When i try: java -jar MyApp.jar
i got : 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)
What am i doing wrong? what else do i need on my classpath, path and/or
in my manifest file?
Thanks a lot. Oleg.

Jon Skeet

unread,
Nov 23, 2001, 3:07:07 AM11/23/01
to

You can't put anything on your classpath or path. The parameter
following -jar must be a full path from the current directory to the jar
file.

--
Jon Skeet - <sk...@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too

P.T.Gowadia

unread,
Nov 23, 2001, 5:17:06 AM11/23/01
to
"o.k." <ol...@cloud9.net> wrote in message news:<3BFD75A2...@cloud9.net>...
This is a workabout, not very elegant, but try putting "."(the current
directory) at the end of your classpath.

Jon Skeet

unread,
Nov 23, 2001, 5:27:07 AM11/23/01
to
P.T.Gowadia <gow...@mailandnews.com> wrote:
> This is a workabout, not very elegant, but try putting "."(the current
> directory) at the end of your classpath.

That won't do anything, for two reasons:

o The classpath environment variable is ignored with -jar
o The -jar option requires you to give the full pathname to the jar file

0 new messages