| Author |
Java -D does not work, why?
|
Dave Elwood
Ranch Hand
Joined: Dec 27, 2002
Posts: 83
|
|
A few days ago when trying to get a glassfish database to run It told me to run :
java -Dij.something.something=somesuch
before starting ij.bat
okay, that worked.
Now I wish to set the system property derby.system.home, so in a batch file I write
java -Dderby.system.home=C:\derby
and java spills out the help screen contents
-- Sorry, that command needs to be followed by a class to execute
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12926
|
|
The -D option sets a Java system property, but only for the JVM instance that you're running at that time. It does not save the value somewhere. A line like this is incomplete:
java -Dderby.system.home=C:\derby
It's missing the name of the class that you want to run. It should be something like:
java -Dderby.system.home=C:\derby org.mypackage.MyClass
I'm sure that the line you had to enter for Glassfish also had something else after it, otherwise you'd have gotten the same help information from Java.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
 |
|
|
subject: Java -D does not work, why?
|
|
|