A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
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?
to run C program in Java
run sh file
Create a windows executable from a jar
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013