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

SystemProperties.set not working

I have following code in my Source code to set SystemProperties. SystemProperties.set("ro.csc.countryiso_code","KoreaA"); String country1 = SystemProperties.get("ro.csc.countryiso_code"); Log.e("DebugA",country1); …
Nikhil Kumar
  • 2,618
  • 3
  • 21
  • 24
0
votes
1 answer

using SystemProperties to get Serial (Brand, Device.. etc) on Android

I develop Android app to show some basic info. Looking at sources, I discovered that android.os.Build has most of needed values /** The name of the overall product. */ public static final String PRODUCT = getString("ro.product.name"); to take a…
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
0
votes
0 answers

Pass values into spring from maven install -Denv=value, deploy on Tomcat

I have a maven project that uses spring and I would like to insert a filename into Spring whose contents has various database information. The filename can either be test.properties, prod.properties or dev.properties. I have seen posted that one can…
John
  • 123
  • 1
  • 11
0
votes
0 answers

How to see Windows's "default" colors in the properties window when using the designer?

It's a "quality of life" question, because there is no bug or anything, but it really annoys me. You can see in Visual Studio, when you're editing your XAML properties, that for a given control, you can select "default" colors for Background and…
Kilazur
  • 3,089
  • 1
  • 22
  • 48
0
votes
1 answer

os.name system property value in Java for Windows Server 2008

Does anyone know the value of the Java system property "os.name" on Windows Server 2008? I found a rally going here (Crowdsourcing a Complete list of Common Java System Properties and Known Values), but nothing on Windows Server 2008. Any help is…
Brian
  • 1
  • 2
0
votes
1 answer

Log4j crashes with NullPointerException when log4j.configurationFile system property exists

I'm quite new to the Log4j2, so may be it isn't a bug just I don't know how to use it properly. I would like to configure the Log4j2 via configuration file specified by the log4j.configurationFile system property. In my previous experiments I was…
mTUX
  • 61
  • 1
  • 5
0
votes
2 answers

How to read "OS variables" from Java (not System.properties)

I just read the excellent 12 Factor App document and it really registered with me. In Chapter 3 Config, the author stresses that: The twelve-factor app stores config in environment variables (often shortened to env vars or env). Env vars are easy…
0
votes
1 answer

overriding system properties in maven

I have a web application with a couple of profiles - for production and for local testing; build is executed with maven; logback is used for logging so some of logs write to files - the problem is: in production we use tomcat and CATALINA_HOME is…
tania
  • 1,086
  • 2
  • 12
  • 31
0
votes
1 answer

unable to read system properties inside jar which is in classpath of another java project

My project has a jar in classpath with some utilities in it. When I run the program using ant on Red Hat linux, it's unable to read the system properties using System.getProperty(key), but it works perfectly fine when ran on Ubuntu. Any suggestion…
Max
  • 1,202
  • 1
  • 13
  • 21
0
votes
2 answers

Restoring system property ("os.name")

So while coding I accidentaly clicked on "clearProperty" instead of "getProperty"... I've cleared "os.name" and now I'm getting null every time I try to read it. How can I restore it to generic state? If I can't do it automatically, how should I…
Ernio
  • 948
  • 10
  • 25
0
votes
2 answers

Have System properties always values

Do System.getProperty("line.separator") and System.getProperty("os.name") always have values? Or do I need to check the return value in the code for null?
Mahsa
  • 85
  • 1
  • 11
0
votes
0 answers

Way to configure system properties for EJB?

Maybe a duplicate question, however, I did not find any answer to it. I have an MDB, I'd like to configure some system properties in descriptor files, these properties must be available during deployment. where should I put these property name-value…
user1684651
  • 390
  • 1
  • 8
  • 21
0
votes
2 answers

Jenkins - Propagate system property to ant task

Dos it exist a way to propagate java system property from Tomcat to jenkins ant task? Particularly I would like to propagate catalina.home property to ant task. When trying catalina.home=${catalina.home} I get error Property catalina.home was…
agad
  • 2,192
  • 1
  • 20
  • 32
0
votes
1 answer

Run Tomcat in debugging mode with system properties

I am trying to run tomcat in debuging mode. In the startup I want to add also some system properties, but I could not achieve this. I am running : ./catalina.sh jpda run -Dtest.variable="value" and when I try to access the value of the…
pokeRex110
  • 833
  • 2
  • 14
  • 26
0
votes
1 answer

Why System.setProperty cannot change the configuration attribute in Hadoop?

My environment is ubuntu12.04+eclipse3.3.0+hadoop0.20.2 When I test on the System.serProperty, which would change the configuration defined in xml file. But I don't get the same effect when I test it. Here is my code snippet: //cofiguration class…
Judking
  • 6,111
  • 11
  • 55
  • 84
1 2 3
17
18