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
0 answers

Using System.getProperty("user.dir") to get location of project when hosted on AWS, but getting NoSuchFileException

This is working correctly locally, but not when hosting on AWS. I've been attempting to debug this for a week and can't seem to crack it. Here is the code block that I believe is causing my issue. In short, I'm attempting to find the "resources"…
0
votes
1 answer

Manually opened Excel / Notepad file (Opened by user), How would like to identify this through java program

Description : Actually I am looking the java code which is basically running in the background, But whenever I want to open a new notepad or excel file , It will capture those file as an input and display the result in output console. How I can do…
0
votes
0 answers

how to Use system properties to pass parameters to the runner/maven build

I want to run my test in three different preset resolution: 768x1024, 360x740, 1920x1024 using the existing framework. And I have to use system properties to pass parameters to the runner/maven build. I've tried systemPropertyVariable. It worked…
0
votes
1 answer

How to invoke a maven profile multiple times with different system properties

I have around 15 maven profiles which are identical except that they have different systemPropertyVariables in their configuration. I would like to execute them all with a single command, and I know I can use this: Executing multiple maven…
Sagol Goru
  • 43
  • 1
  • 4
0
votes
0 answers

Feed JAVA_OPTS with multiple parameters

How do I feed a program with multiple parameters as JAVA_OPTS? When I use something like this: JAVA_OPTS="Dx=x1,-Dy=y1" The value that results for x is "x1,-Dy=y1" and the string is not recognised as list. I didn't find any example with multiple…
AHH
  • 981
  • 2
  • 10
  • 26
0
votes
1 answer

Environment variables not converted to system properties

Working on a legacy Spring based application (Spring 4.3), I have a strange behavior: environment variables are not resolved by Spring. For example I have this environment variable: HOST_SERVICE_BASE_URL, when I refer to it in the application with…
akuma8
  • 4,160
  • 5
  • 46
  • 82
0
votes
2 answers

why do we set system properties in our java code?

In java, we set system properties with System.SetProperties(Key, Value). I have the following queries related to it. On what occasion we set the system properties in our code? How do we determine the Key? i.e. How we will know what exact string we…
MrNolan
  • 154
  • 1
  • 4
  • 13
0
votes
1 answer

System.getProperty() showing null

How so I get the default value of system property in java like ntlm.debug or jdk.tls.stapling. ignoreExtensions On using system.getProperty(Property name) gives null. I am running with jdk version 11.0.7 Is there any other way to get default values…
nzare
  • 23
  • 6
0
votes
1 answer

Is it possible to use Java system property variable in XInclude attribute href?

I am using the ActiveMQ Artemis split broker.xml feature and including xml file. I am trying to use Java system property for xml file path. But it is throwing error. Here is the line I am trying.
greja
  • 134
  • 10
0
votes
1 answer

How can I get PythonInterpreter to recognize datetime and other modules such as psutils in python?

I am running a python program called diagnostics.py from a java class called PyInterpreter that intializes a jython PythonInterpreter object and a file to use and can run methods from that python program. My python program looks like this: import…
0
votes
0 answers

How can I specify 2 different values of same system property or VM Argument?

I have a system property which I use in my Intellij's VM arguments section as -Djava.security.krb5.realm="EXAMPLE1.COM", I want to use another value for the realm name instead of EXAMPLE1.COM when I connect to another resource. For example, my…
0
votes
1 answer

Setting system properties before bean initialization in spring-boot

I'm adding some system properties inside a @PostConstruct decorated method of a bean like shown below : @Profile("dev") @Component public class DeveloppementPropertySetter { @PostConstruct public void setProperty() { …
Parison
  • 179
  • 1
  • 2
  • 8
0
votes
1 answer

Set Java systemProperties for all Java Processes

I have a system Property (JVM Provided) called networkaddress.cache.ttl. This setting has a bad default of -1 and should be set to a different value (e.g.: 60). I know that this can be set by calling java -Dnetworkaddress.cache.ttl=60 -jar…
Alexander Oh
  • 24,223
  • 14
  • 73
  • 76
0
votes
1 answer

How to create custom build.prop file to custom directory in aosp?

I am working on aosp and have two questions about build.prop. 1) Normally, build.prop file is located to /system directory. I'd like create to custom build.prop file and save it to different directory. For example, I have tvconfig directory and…
Batuhan Avlayan
  • 411
  • 1
  • 4
  • 19
0
votes
1 answer

log4j2.xml is not picking the changes in system properties during the runtime?

Creating an spring-boot app with log4j2 logger and server is wildfly10/jboss7.1. I added "system property": "loglevel" from Configuration: System Properties and able to access this from spring boot application. I called this system property in…