Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
0 answers
40 views

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<propname>=<propvalue> like in the following example: $scala -Dpath.to.folder=/opt/myfolder Scala v3 ...
Alessandro Caproni's user avatar
4 votes
4 answers
4k views

Can I get the path of the currently running java executable?

Suppose I want to run a java program from the command line and I use this command: myExes\java\java.exe AJavaProgram As you can see, java.exe is not in my path, so I am running it manually rather ...
Alexander Porter's user avatar
1 vote
1 answer
607 views

gradle.properties not taking values from command line

I have gradle.properties file for which I am passing value from command line as below command but not taking the value. gradle test -DsystemProp.RunnerApplication=QAEnv -Dgroups=CSP-Smoke My build....
Sobhit Sharma's user avatar
8 votes
0 answers
2k views

How do you set -DargLine system property inside MAVEN_OPTS environment variable?

I'm using maven and have a list of system properties -DA=alpha, -DB=beta -DS=random_stuff that I want to pass down to unit tests when maven runs, and which cannot go into the pom files. Surefire and ...
Christian's user avatar
  • 6,410
5 votes
2 answers
12k views

Java setting system property using command line

While reading java man page, I found the -Dproperty=value flag which stats that by passing this flag, it will create a system property with value = value. I wrote a test java code: class File{ ...
Dheerendra's user avatar
  • 1,568
0 votes
1 answer
655 views

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"); ...
stantonk's user avatar
  • 2,000
1 vote
2 answers
5k views

Obtaining the "user.dir" system property for a java process from the command line

I am trying to read the system property "user.dir" from the command line for a particular java process. I have seen several examples of obtaining the system property from Java code (System.getProperty)...
user1131528's user avatar
83 votes
5 answers
220k views

Set multiple system properties Java command line

Is there an easier way to specify multiple System Properties on the command line to a Java program rather than having multiple -D statements? Trying to avoid this: java -jar -DNAME="myName" -...
Tyler DeWitt's user avatar
  • 23.6k