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.
joshSCH 1,062 Industrious Poster Banned
Recommended Answers
Jump to PostWhere is your jarfile and where are you trying to do that?
And what's your classpath?
Jump to PostHi 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
Jump to PostHi everyone,
Do this
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.
…
Jump to PostHi everyone,
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
All 16 Replies
jwenting 1,905 duckman Team Colleague
joshSCH 1,062 Industrious Poster Banned
jwenting 1,905 duckman Team Colleague
joshSCH 1,062 Industrious Poster Banned
freesoft_2000 9 Practically a Master Poster
joshSCH 1,062 Industrious Poster Banned
freesoft_2000 9 Practically a Master Poster
joshSCH 1,062 Industrious Poster Banned
freesoft_2000 9 Practically a Master Poster
jwenting 1,905 duckman Team Colleague
freesoft_2000 9 Practically a Master Poster

joankim
Harvey_1 0 Newbie Poster
stultuske 1,116 Posting Maven Featured Poster
John Nataniel 0 Newbie Poster
stultuske 1,116 Posting Maven Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.