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

Build Gradle getProperties before running already made task

I’m trying to use a Java, Serenity-BDD project with gradle version 4.8+, but the application is not pulling the CLI arguments of -Denvironment and -Dservicebranches. I have these properties as blank values in my local.properties file, and they’re…
as.beaulieu
  • 464
  • 1
  • 10
  • 26
0
votes
1 answer

How to change First Day of the Week for filter calendars

I am trying to change the first day of the week for all calendars in service now. glide.ui.date_format.first_day_of_week glide.ui.filter.first_day_of_week glide.ui.date_picker.first_day_of_week Those are the system properties I have created…
0
votes
1 answer

Changing the way my program accepts files will create this error from GSON: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $?

There's been a lot of questions asked about this topic but this question is different because the way I define a certain variable is what determines whether or not this error is thrown. Basically, I have the below JSON file: [ { …
Emily
  • 82
  • 1
  • 10
0
votes
1 answer

Setup system properties and statics just once before running all test classes in java

I have multiple java test classes that extend a common base class. Currently I have two methods - startUp() and shutDown() with @BeforeClass and @AfterClass annotations respectively which make these methods run once before and after each test class.…
ThatNewGirl
  • 47
  • 1
  • 1
  • 3
0
votes
1 answer

Read system property from a target server for JMeter GUI tests

I'm running tests on JMeter on a target server. So I start JMeter(GUI) on my Mac but it points to a Linux server and runs tests against it. I need to read a system property on the target server and use that in my If…
user1124236
  • 453
  • 2
  • 7
  • 17
0
votes
1 answer

Wildfly Injection depending on Condition (system-property)

I am working with Wildfly atm and I am trying to get into @Annotations. Having several implementations for some interfaces I want my application to pick a certain implementation depending on some condition (depending on a system-property, specified…
Ciprian
  • 139
  • 1
  • 3
  • 12
0
votes
2 answers

How to pass System.getProperty("skipIndexing") value to a Java Server while starting?

We are using Mule Server but this question is generally for all server. In constructor we have following property named skipindexing. if (!Boolean.parseBoolean(System.getProperty("skipIndexing"))) { …
fatherazrael
  • 5,511
  • 16
  • 71
  • 155
0
votes
1 answer

How to add system property to exe file in java

I have a project in java, which i want to run only if the user is admin, for that I set system property to admin - -Duser=admin I export my project to a jar and create its exe. How can i set system property for exe file? How to verify if user is…
Chetna rustagi
  • 463
  • 7
  • 21
0
votes
1 answer

Groovylang: setting system properties are not persistent?

Here we have the following issue while setting a java-system properties. Env: Groovy Version: 2.4.12 JVM: 1.8.0_141 Vendor: Oracle Corporation OS: Windows 7 a) Setting and printing a system property in one Groovy script, for e.g. setprop.groovy…
CodeFreezr
  • 362
  • 2
  • 18
0
votes
1 answer

Java set persistent environment variable

I have set environment varible through System.setProperty("mykey" : "itsvalue"); I am retrieving it as : System.getProperty("mykey"); I get the mykey retrieved properly, but when I restart my service, mykey also get erased. How to save the mykey…
usr_11
  • 548
  • 10
  • 31
0
votes
1 answer

IntelliJ copyright at compile time

I'm working on a build script that will generate new files for my project at compile time. These files will be shared publicly so they need to include the correct copyright information. Is there any way to reference the copyright profile from…
0
votes
1 answer

Using property from pom to run test @FitNesseRunner.Suite

How can I use the settings in the POM for running tests from FitNesseRunner: ${fitnesseSuiteToRun}
Saskia
  • 1
0
votes
2 answers

Set system property in jmockit unit test

Using a combination of testng and jmockit to do some unit testing. In a method I am testing, it tries to access a system property that I set using a JBoss deploy script, therefore my unit test doesn't have access to the entire JBoss environment to…
Drew13
  • 1,301
  • 5
  • 28
  • 50
0
votes
2 answers

If we're told to use the system property line.separator instead of hard-coding \n, why does my code work on Windows?

We all read something like this: use the System.getProperty(String) method to refer to items which depend on the system, such as line terminators and path separators. The quote is copied from this web site. I hard-coded an \n, and the code…
Maksim Dmitriev
  • 5,985
  • 12
  • 73
  • 138
0
votes
2 answers

Force java.net.preferIPv4Stack to true

I'm currently working on a Java application implying multicast connection. My development machine is a Mac, and I'm having troubles connecting to the multicast group. I fixed it by adding the argument -Djava.net.preferIPv4Stack=true is my running…
faku
  • 411
  • 4
  • 19