Questions tagged [system-properties]

System properties a key value pairs that can be provided to an application, often used to configure it at run time.

In Java there is a set of predefined properties that specify things like operation system, java version and the current user. A complete list can be found at http://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html

One can also provide arbitrary system properties when executing a java application using the -D commandline parameter like the following example:

java -Dkey=value ClassToExecute

Inside the program the properties can be accessed using System.getProperties() or similar methods in the same class.

260 questions
0
votes
1 answer

Why would you want to set system properties such as java.vm.specification.version on App Engine?

According to the App Engine documentation, you can set system properties and environment variables for your app in the deployment descriptor and App Engine sets the following system properties when it initializes the JVM on an app server: *…
Viktor Gavras
  • 55
  • 1
  • 5
0
votes
1 answer

Why does -Dproperty=value not work if -jar is specified first?

Given the following class: public class SpecifySystemPropertiesCommandLine { public static void main(String[] args) { String prop1 = System.getProperty("prop1", "defaultvalue"); String prop2 = System.getProperty("prop2",…
stantonk
  • 1,922
  • 1
  • 18
  • 24
0
votes
2 answers

Nested system properties in Java command line

Is there a way to nest system properties in a Java command line? For instance, specifying something like: java -DworkingDir=/tmp -DconfigFile=${workingDir}/someFile.config. I aim to use something like that for the Tomcat launch configuration in…
Doc Davluz
  • 4,154
  • 5
  • 30
  • 32
-1
votes
1 answer

Spring Special Beans

Can we declare a special spring bean which can be instantiated before spring checks for the Spring Profiles declarations? The challenge is to set the active spring profile from a spring bean , but it seems spring looks for declared profiles and then…
Prakash
  • 461
  • 1
  • 5
  • 21
-1
votes
2 answers

Grails "war" command, how to set system property

I'm running grails prod war to create my app's .war file. The problem is, I need to somehow set a system property that can be accessed in grails-app/conf/Config.groovy when that .war is being built. How can I do this? Grails version 2.1.0
Madbreaks
  • 19,094
  • 7
  • 58
  • 72
1 2 3
17
18