• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

classpath settings for jar files

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm having troubles executing my client.jar file.
I installed the jar file in a temp folder
C:\temp\client.jar
When I navigate to that folder and state

java -jar client.jar


it works fine.
When I add that folder to my CLASSPATH and try to start the jar from a different location I get :


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)


When I unjar the jar file and try to start the application from a different location it works fine. So I conclude that my CLASSPATH is correct.
Can anyone tell me what I'm forgetting or doing wrong ?
I tried to add the jar file to the CLASSPATH but that doesn't seem to solve it.
Thx
A.
[ October 28, 2002: Message edited by: Andrew Collins ]
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I installed the jar file in a temp folder
C:\temp\client.jar
When I navigate to that folder and state

quote:
--------------------------------------------------------------------------------
java -jar client.jar
--------------------------------------------------------------------------------
it works fine.


So then your problem would be what?
This is the correct way of executing your client. You should be able to put the jar file in any directory, go to that directory and run your client with your above instructions.
In your readme.txt it should state that explicitly and it will be fine.
Mark
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic