A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Java SE 8 for the Really Impatient
this week in the
Java in General
Java -D does not work, why?
Joined: Dec 27, 2002
Nov 19, 2012 01:02:37
A few days ago when trying to get a glassfish database to run It told me to run :
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
and java spills out the help screen contents
-- Sorry, that command needs to be followed by a class to execute
Jesper de Jong
Joined: Aug 16, 2005
Nov 19, 2012 01:23:14
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:
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
- My blog about Scala
I agree. Here's the link:
subject: Java -D does not work, why?
Why javac requires .java extension and java command does not?
Create a windows executable from a jar
run sh file
to run C program in Java
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014