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

Configuring System property in Spring

I have file channel adapter which need to listen to a directory in specfied intervals. And I have the following code.
nobody
  • 1,909
  • 5
  • 31
  • 45
0
votes
0 answers

could @@SERVERNAME be redefined to return an alias

A vendor application has a routine that does some validation by using @@Servername in SQL. This returns the name of the instance but I would prefer it returned the name of the Alias (SQL defined) for that instance. Is it possible? Examples:…
0
votes
1 answer

How to update java project properties with gradle commandline

I'm working on a java project and currently loading properties by: properties.load(ConfigProperty.class.getClassLoader().getResourceAsStream("project.properties")); But sometimes I also need to run from command line and pass values to override the…
0
votes
1 answer

How to set a default value to a string using System Poperties?

I'm trying to use Java system properties to take values from Command line as follows in my build.xml file -
jjl
  • 15
  • 2
0
votes
1 answer

How to get windows domain name in gradle taks?

I am to switch between DB localhost or a dev server DB depending on the system I am running the code. in the build.gradle System.getenv() System.getProperty("test.property") but this one comes as null. 2 possible solutions, 1) set the System…
sachyy
  • 532
  • 4
  • 8
0
votes
1 answer

No value for 'org.quartz.scheduler.instanceId'

I have a problem with an application war, the application was not made by me, the application works, but when import to eclipse and export with attaching tomcat and java libraries 1.8.0_321, it does not work, I do not change anything in the…
martuo
  • 3
  • 2
0
votes
0 answers

Unable to run a local git repo project on jenkins tomcat beacuse of local checkout in system property

I am trying to run a project on jenkins using local git repo. I checked out this solution. However I am confused if is it to be written in script console. I tried installing all latest plugins for git. I am not understanding how do I allow local…
aslan
  • 1
  • 1
0
votes
0 answers

Setting dynamic password from Maven

We've started using an AWS CodeArtifact Maven repository. Before connecting, developers must run a command ("aws") to acquire a temporary access token. How can I configure Maven to acquire and use this token automatically, without requiring…
Steve Mitchell
  • 1,895
  • 1
  • 15
  • 12
0
votes
1 answer

What happens when I declare a custom system property in java?

Wondering what happens when I declare a custom property in java using -D command. I came to know that other system properties are not stored, instead generated by JVM. So what will happen to the property that I created? Can I use it next time while…
0
votes
1 answer

Run a jar file out of java programm with many system properties

I want to start a .jar File out of my java program using the Process Builder like this: ProcessBuilder pb = new ProcessBuilder("java", "-Xdebug", "-DpropKey1=value", "-DpropKey2=value", "MyJar.jar"); Process p = pb.start(); I am looking for a…
aslanj
  • 71
  • 6
0
votes
0 answers

How to pass system properites in comand line to scala 3 executable

With scala 2 it was possible to pass system properties in the command line using -D= like in the following example: $scala -Dpath.to.folder=/opt/myfolder Scala v3 does not accept -D in the command line anymore: $ scala…
0
votes
2 answers

Quarkus unit-testing and properties

I have a basic question about Quarkus testing, I would like to execute the command ./mvnw clean test but I need to use a token to init the application. I have configured application-test.properties file to store the token: discord.token=XYZ So, in…
0
votes
1 answer

How to perform system property operations in WildFly via REST?

This documentation states that one can perform certain operations for a WildFly server via REST: https://docs.jboss.org/author/display/WFLY10/The%20HTTP%20management%20API.html However, there is no example how to add/remove/read a system property. I…
Baradé
  • 1,290
  • 1
  • 15
  • 35
0
votes
2 answers

How to append value to a system property using command line

When setting property value via command line, the whole value will be replaced. Example: $ java -XshowSettings:properties ... Property settings: <...snip...> java.library.path = /usr/java/packages/lib /usr/lib64 /lib64 …
Anthony
  • 1,877
  • 17
  • 21
0
votes
1 answer

How to know if a computer has multiple monitors connected to it?

My system monitoring app takes screenshot every five minutes it runs in a system. But for a system connected in dual monitor mode needs a different set of codes to take the complete 180 degree screenshot. Is there a way to know if the system is…
Ananthu K Kumar
  • 86
  • 2
  • 10