'Unable to access jarfile'

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Jul 2005
Posts: 4,845
Reputation: joshSCH is on a distinguished road 
Solved Threads: 10
joshSCH's Avatar
joshSCH joshSCH is offline Offline
Banned

'Unable to access jarfile'

 
0
  #1
Jul 29th, 2005
When I try to execute my jar file through the command prompt by typing:
java -jar myJar.jar
It returns an error message saying that it can not access the jar file. Why is this? myJar.jar is the exact name of my jar file.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: 'Unable to access jarfile'

 
0
  #2
Jul 30th, 2005
Where is your jarfile and where are you trying to do that?
And what's your classpath?
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 4,845
Reputation: joshSCH is on a distinguished road 
Solved Threads: 10
joshSCH's Avatar
joshSCH joshSCH is offline Offline
Banned

Re: 'Unable to access jarfile'

 
0
  #3
Jul 30th, 2005
my jar file is MyJar.jar located at C:\Documents and Settings\Josh\My Documents\JAVA Programs.
My Class path is payroll, The jarfile and manifest files are all correct I believe.
I am trying to execute 'payroll' through the command prompt.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: 'Unable to access jarfile'

 
0
  #4
Jul 30th, 2005
you'd have to be in that very directory then. And add '.' to your classpath and path.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 4,845
Reputation: joshSCH is on a distinguished road 
Solved Threads: 10
joshSCH's Avatar
joshSCH joshSCH is offline Offline
Banned

Re: 'Unable to access jarfile'

 
0
  #5
Jul 31st, 2005
how would you get into that directory?
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 609
Reputation: freesoft_2000 is an unknown quantity at this point 
Solved Threads: 8
freesoft_2000 freesoft_2000 is offline Offline
Practically a Master Poster

Re: 'Unable to access jarfile'

 
0
  #6
Jul 31st, 2005
Hi everyone,

Do this list what is in your manifest file here. Also list exactly what you are typing on the command line with all the full path and class path so we can see what's wrong

Richard West
Microsoft uses "One World, One Web, One Program" as a slogan.
Doesn’t that sound like "Ein Volk, Ein Reich, Ein Führer" to you, too?
— Eric S. Raymond

Tell me what type of software do you like and what would you pay for it

http://www.daniweb.com/techtalkforums/thread19660.html
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 4,845
Reputation: joshSCH is on a distinguished road 
Solved Threads: 10
joshSCH's Avatar
joshSCH joshSCH is offline Offline
Banned

Re: 'Unable to access jarfile'

 
0
  #7
Jul 31st, 2005
I am sure that my jar and manifest files are correct:
Manifest-Version: 1.0
Created-By: 1.4.2_04 (Sun Microsystems Inc.)
Main-Class: Payroll


I was typing in the command prompt: java -jar myJar.jar
it returns 'unable to access jar file.

my jar file is myJar.jar located at C:\Documents and Settings\Josh\My Documents\JAVA Programs.
My Class path is payroll
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 609
Reputation: freesoft_2000 is an unknown quantity at this point 
Solved Threads: 8
freesoft_2000 freesoft_2000 is offline Offline
Practically a Master Poster

Re: 'Unable to access jarfile'

 
0
  #8
Jul 31st, 2005
Hi everyone,

Do this

  1. java -jar -cp .;C:\Documents and Settings\Josh\My Documents\JAVA Programs myjar.jar

I haven't run java programs from the command line for quite some time but i think this is it. Someone correct me if i am wrong

The manifest file looks correct.

Let me know if it works

Richard West
Microsoft uses "One World, One Web, One Program" as a slogan.
Doesn’t that sound like "Ein Volk, Ein Reich, Ein Führer" to you, too?
— Eric S. Raymond

Tell me what type of software do you like and what would you pay for it

http://www.daniweb.com/techtalkforums/thread19660.html
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 4,845
Reputation: joshSCH is on a distinguished road 
Solved Threads: 10
joshSCH's Avatar
joshSCH joshSCH is offline Offline
Banned

Re: 'Unable to access jarfile'

 
0
  #9
Jul 31st, 2005
hmm.. when I type that in it says 'Unable to access jarfile and'
Maybe its because the starting prompt says: C:\Documents and Settings\Josh> ?
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 609
Reputation: freesoft_2000 is an unknown quantity at this point 
Solved Threads: 8
freesoft_2000 freesoft_2000 is offline Offline
Practically a Master Poster

Re: 'Unable to access jarfile'

 
0
  #10
Aug 1st, 2005
Hi everyone,

Originally Posted by joshSCH
hmm.. when I type that in it says 'Unable to access jarfile and'
Maybe its because the starting prompt says: C:\Documents and Settings\Josh> ?
The starting prompt needs to be the location of java.exe

Richard West
Microsoft uses "One World, One Web, One Program" as a slogan.
Doesn’t that sound like "Ein Volk, Ein Reich, Ein Führer" to you, too?
— Eric S. Raymond

Tell me what type of software do you like and what would you pay for it

http://www.daniweb.com/techtalkforums/thread19660.html
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC