I try to run my jar files and i take msg like above:
C:\Documents and Settings\Christina>java -jar tools.jar
Unable to access jarfile tools.jar
What i should do???
Well I guessed you fixed this by now.
You may get the above error if:
- 'tools.jar' is not in the current working directory (since you have provided a relative path)
- no main class is defined by the jar file (cf. java tutorial for defining manifest files and declaring main class in definition of jar files)
If you do not wish to define a main class, then you want to use -cp, rather than -jar, to put the jar on the classpath
java -cp MY_JAR_FILE.jar HelloWorld
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.