The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
William Brogden wrote:Exactly how are you trying to "run the same folder"?
Bill
The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:javaw has a nasty habit of displaying the same error message for any throwable that's thrown from the main method.
How are you launching the JVM from the command line?
The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
SCJP
Visit my download page
hi robRob Spoor wrote:You did not answer my question. What do you enter on the command line when it runs fine?
The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:To be honest, I doubt it. Windows doesn't use forward slashes as path separators but backslashes. Perhaps you meant that that is the current path; then it would work. It would also mean that double clicking the JAR file (which does little more than call javaw.exe -jar Myapp.jar) should work as well. If it doesn't it's probably a class path issue. Did you set the class path inside that command line window? Or did you set it up as an environment variable? Either way, the preferred way of setting class paths for JAR files is to put it in the JAR's MANIFEST.MF file, as the value of the Class-Path attribute. See this for more information.
The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
.That java -jar Myapp.jar command is working on your desktop
Is it also working on your laptop?
.I still think there is a class path issue
Maybe it's not in the CLASSPATH environment variable,
but some library you put in the /lib/ext sub folder of the JRE installation.
On the other hand, the cause could be something completely different. Perhaps you're trying to read from a file that doesn't exist on the laptop, or you have no rights to read that file. Likewise for writing a file or creating a directory
The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
Paul Clapham wrote:Nobody seems to have mentioned yet that "java -jar something.jar" ignores any classpath settings, except for those specified as "Class-Path" entries in the jar's manifest.
The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
Paul Clapham wrote:Nobody seems to have mentioned yet that "java -jar something.jar" ignores any classpath settings, except for those specified as "Class-Path" entries in the jar's manifest.
The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
naved momin wrote:
Paul Clapham wrote:Nobody seems to have mentioned yet that "java -jar something.jar" ignores any classpath settings, except for those specified as "Class-Path" entries in the jar's manifest.
so you mean i need to set the classpath in the menifiest file inside the "something.jar"
which is empty for now
Henry Wong wrote:
naved momin wrote:
Paul Clapham wrote:Nobody seems to have mentioned yet that "java -jar something.jar" ignores any classpath settings, except for those specified as "Class-Path" entries in the jar's manifest.
so you mean i need to set the classpath in the menifiest file inside the "something.jar"
which is empty for now
That depends. Does your jar files depend on external jar files (or any external classes)? If it does, then yes, you need to have those jar files also copied over to the other machine, and your jar files needs to reference it.
If it doesn't, then empty "Class-Path" should be fine.
Henry
The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
naved momin wrote:
so no answers i guess , now i m thinking making jars for distributing the code is a hell ,
it could run or not depends on the destiny of the end user ...lol
i guess exe is much better options for windows platform
naved momin wrote:
k , but any way the jar is not running from double click and runs fine through cmd with the fully qualified path to the jar files (absolute path)
Why am I so drawn to cherry pie? I can't seem to stop. Save me tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|