Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

classpath settings for jar files

 
Andrew Collins
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • 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 ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic