aspose file tools*
The moose likes Java in General and the fly likes Unable to access jar file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Unable to access jar file" Watch "Unable to access jar file" New topic
Author

Unable to access jar file

Talitha Bell
Greenhorn

Joined: Oct 01, 2007
Posts: 29
Hi All


I tried to access jar file by the command

java -jar JAVA_HOME\demo\jfc\Java2D\Java2Demo.jar from c:\>

but give error [Unable to access jarfile JAVA_HOME\demo\jfc\Java2D\Java2Demo.jar]

i gave the full path instead of JAVA_HOME[C:\Program Files\Java\jdk1.5.0_12] but same problem



but when I tried to access jar file from the directory [C:\Program Files\Java\jdk1.5.0_12\demo\jfc\Java2D]
by command java -jar Java2Demo.jar
it works fine

any one tell me why ,how i will access it from c:\>


Thanks, Talitha
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

You have to tell the command processor you are using an environment variable. On windows, this is done by enclosing the variable in %:

Using the full path:

works for me as well.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19720
    
  20

It would be better to use quotes, so you can have spaces in the path:

Using the full path:


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Talitha Bell
Greenhorn

Joined: Oct 01, 2007
Posts: 29
Thanks
Joe Ess and Rob Prime for reply

Rob formula works fine.
 
wood burning stoves
 
subject: Unable to access jar file