This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes java -jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java -jar" Watch "java -jar" New topic

java -jar

Raja Sathci

Joined: Sep 16, 2005
Posts: 10
I have set an jar file in a Windows environment variable classpath. Have also confirmed the changes by running the command
echo %classpath%
it does show the jar file.
But however when i run the command java -jar jarfilename it says " unable to access jarfile"

Can any one please help how to overcome this issue

Thanks in advance.

Paul Clapham

Joined: Oct 14, 2005
Posts: 19747

If you're using "java -jar" then your classpath is completely irrelevant.

Are you sure you copied and pasted the error message exactly? That looks more like a paraphrase to me.
I agree. Here's the link:
subject: java -jar
It's not a secret anymore!