No, you're right, I was misremembering. java.exe is put into windows\system32 or similar.

Quote:

Originally Posted by Java Programmer

So Users need the path and not the classpath?

So, the PATH will be correct for the user. And the CLASSPATH will be ignored because that's what happens when you run "java -jar".

January 7th, 2012, 05:35 PM

Java Programmer

Re: Jar file only Works on my computer?

?

So they need the classpath or they do not need the classpath

January 7th, 2012, 05:54 PM

pbrockway2

Re: Jar file only Works on my computer?

The CLASSPATH setting will be ignored when they run "java -jar YourProgram.jar". So in that sense they don't need it.

When you run an executable jar the classpath comes from what is specified in the manifest. That's why if your program is not running on another machine we need to see the details - the command, the output, the manifest file, at least.

If you are testing your program on another machine then installing the JDK on that machine was not a good move. The aim is to run your program on another computer without altering its settings. That's quite possible (and is the "ordinary" state of affairs) and if corrections need to be made, they need to be made to how your are creating the jar file.

The OP never posted the console when the jar was executed from the commandline.
The one posting was for the case where the jar file was not seen by the java command, probably because the OP was in the wrong folder or misspelled the name of the jar file. Hard to say.

January 7th, 2012, 06:14 PM

Java Programmer

Re: Jar file only Works on my computer?

This happend a month before when i exported it from eclipse?

January 7th, 2012, 06:37 PM

Java Programmer

Re: Jar file only Works on my computer?

Quote:

Originally Posted by Norm

The OP never posted the console when the jar was executed from the commandline.
The one posting was for the case where the jar file was not seen by the java command, probably because the OP was in the wrong folder or misspelled the name of the jar file. Hard to say.

Ive Check My Spelling and nothing is misspelled.
I Do Not Understand What this means, ive made the jar file 5 times and i kept getting the same thing!! D:

January 7th, 2012, 07:00 PM

Norm

Re: Jar file only Works on my computer?

When are you going to try what I suggested in post #3 & #11?

January 7th, 2012, 07:35 PM

Java Programmer

Re: Jar file only Works on my computer?

i no longer have the error?
not to disrespect you but i did already just without everything, like the same exact example you posted

January 7th, 2012, 07:41 PM

Norm

Re: Jar file only Works on my computer?

I got the same error message as you reported when I entered an madeup jar file name. If the file had been there you get a different error message. My assumption was that either the file was in another folder or the name was misspelled. Here's what I get when java finds a jar without a manifest: