Get list of system properties from command line onlyHow to get an enum value from a string value in Java?Setting Java system properties without putting the values on the command lineSet multiple system properties Java command lineObtaining the “user.dir” system property for a java process from the command lineHow to avoid Java system properties on command line?How do I run a Java program from the command line on Windows?Problems passing system properties and parameters when running Java class via GradleReading Java system properties from command lineCan command-line set Java system properties be distinguished from the defaults?Command line parameters in Java
Are actors contractually obligated to certain things like going nude/ Sensual Scenes/ Gory Scenes?
What was the deeper meaning of Hermione wanting the cloak?
How should I avoid someone patenting technology in my paper/poster?
Can planetary bodies have a second axis of rotation?
Is the sentence "何でも忘れた" correct?
What do solvers like Gurobi and CPLEX do when they run into hard instances of MIP
Do household ovens ventilate heat to the outdoors?
Can one guy with a duplicator initiate a nuclear apocalypse?
Cheap antenna for new HF HAM
Why there so many pitch control surfaces on the Piaggio P180 Avanti?
Pseudo Game of Cups in Python
How is underwater propagation of sound possible?
How to influence manager to not schedule team meetings during lunch?
Is it possible that the shadow of The Moon is a single dot during solar eclipse?
GitHub repo with Apache License version 2 in package.json, but no full license copy nor comment headers
Escape the labyrinth!
As an employer, can I compel my employees to vote?
Linear independence of element-wise powers of positive vectors
Is there any reason nowadays to use a neon indicator lamp instead of an LED?
How would a native speaker correct themselves when they misspeak?
What do these pins mean? Where should I plug them in?
Microservices and Stored Procedures
Are there hydrocarbons on the Moon?
Could someone please show me the steps of this sum?
Get list of system properties from command line only
How to get an enum value from a string value in Java?Setting Java system properties without putting the values on the command lineSet multiple system properties Java command lineObtaining the “user.dir” system property for a java process from the command lineHow to avoid Java system properties on command line?How do I run a Java program from the command line on Windows?Problems passing system properties and parameters when running Java class via GradleReading Java system properties from command lineCan command-line set Java system properties be distinguished from the defaults?Command line parameters in Java
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
This is similar to a pretty basic question, I'm trying to find a list of system properties passed to the java program from the command line only. E.g., running
java -Dsome.property=value -Dother.property=value2
I'm trying to get a list of JUST these properties. Ignore the specific property names in the example, the actual command line arguments will be arbitrarily named so it is not feasible to explicitly call System.getProperty("some.property")
for each property I need.
System.getProperties()
returns many properties that I do not have any interest in. Is it possible to differentiate between properties set on the command line when starting the program vs those that come from elsewhere?
java grails groovy
add a comment
|
This is similar to a pretty basic question, I'm trying to find a list of system properties passed to the java program from the command line only. E.g., running
java -Dsome.property=value -Dother.property=value2
I'm trying to get a list of JUST these properties. Ignore the specific property names in the example, the actual command line arguments will be arbitrarily named so it is not feasible to explicitly call System.getProperty("some.property")
for each property I need.
System.getProperties()
returns many properties that I do not have any interest in. Is it possible to differentiate between properties set on the command line when starting the program vs those that come from elsewhere?
java grails groovy
add a comment
|
This is similar to a pretty basic question, I'm trying to find a list of system properties passed to the java program from the command line only. E.g., running
java -Dsome.property=value -Dother.property=value2
I'm trying to get a list of JUST these properties. Ignore the specific property names in the example, the actual command line arguments will be arbitrarily named so it is not feasible to explicitly call System.getProperty("some.property")
for each property I need.
System.getProperties()
returns many properties that I do not have any interest in. Is it possible to differentiate between properties set on the command line when starting the program vs those that come from elsewhere?
java grails groovy
This is similar to a pretty basic question, I'm trying to find a list of system properties passed to the java program from the command line only. E.g., running
java -Dsome.property=value -Dother.property=value2
I'm trying to get a list of JUST these properties. Ignore the specific property names in the example, the actual command line arguments will be arbitrarily named so it is not feasible to explicitly call System.getProperty("some.property")
for each property I need.
System.getProperties()
returns many properties that I do not have any interest in. Is it possible to differentiate between properties set on the command line when starting the program vs those that come from elsewhere?
java grails groovy
java grails groovy
edited Mar 28 at 17:01
Daniel
2,3011 gold badge7 silver badges25 bronze badges
2,3011 gold badge7 silver badges25 bronze badges
asked Mar 28 at 14:51
TreblaTrebla
6741 gold badge6 silver badges22 bronze badges
6741 gold badge6 silver badges22 bronze badges
add a comment
|
add a comment
|
1 Answer
1
active
oldest
votes
Is it possible to differentiate between properties set on the command
line when starting the program vs those that come from elsewhere?
As far as I know, this is not supported. By the time your code is executing, the command line system properties have already been munged with all of the others.
Depending on what you are really trying to accomplish, one thing to consider might be to not set them as command line system properties but instead pass them as parameters to your program so you can evaluate them and then set them as system properties in your main
method before much of your other code executes.
I hope that helps.
It does. I did work around it as you suggest, but was still curious if it was possible. Good to know it's not.
– Trebla
Mar 28 at 18:41
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55400584%2fget-list-of-system-properties-from-command-line-only%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is it possible to differentiate between properties set on the command
line when starting the program vs those that come from elsewhere?
As far as I know, this is not supported. By the time your code is executing, the command line system properties have already been munged with all of the others.
Depending on what you are really trying to accomplish, one thing to consider might be to not set them as command line system properties but instead pass them as parameters to your program so you can evaluate them and then set them as system properties in your main
method before much of your other code executes.
I hope that helps.
It does. I did work around it as you suggest, but was still curious if it was possible. Good to know it's not.
– Trebla
Mar 28 at 18:41
add a comment
|
Is it possible to differentiate between properties set on the command
line when starting the program vs those that come from elsewhere?
As far as I know, this is not supported. By the time your code is executing, the command line system properties have already been munged with all of the others.
Depending on what you are really trying to accomplish, one thing to consider might be to not set them as command line system properties but instead pass them as parameters to your program so you can evaluate them and then set them as system properties in your main
method before much of your other code executes.
I hope that helps.
It does. I did work around it as you suggest, but was still curious if it was possible. Good to know it's not.
– Trebla
Mar 28 at 18:41
add a comment
|
Is it possible to differentiate between properties set on the command
line when starting the program vs those that come from elsewhere?
As far as I know, this is not supported. By the time your code is executing, the command line system properties have already been munged with all of the others.
Depending on what you are really trying to accomplish, one thing to consider might be to not set them as command line system properties but instead pass them as parameters to your program so you can evaluate them and then set them as system properties in your main
method before much of your other code executes.
I hope that helps.
Is it possible to differentiate between properties set on the command
line when starting the program vs those that come from elsewhere?
As far as I know, this is not supported. By the time your code is executing, the command line system properties have already been munged with all of the others.
Depending on what you are really trying to accomplish, one thing to consider might be to not set them as command line system properties but instead pass them as parameters to your program so you can evaluate them and then set them as system properties in your main
method before much of your other code executes.
I hope that helps.
answered Mar 28 at 15:49
Jeff Scott BrownJeff Scott Brown
16.9k1 gold badge19 silver badges33 bronze badges
16.9k1 gold badge19 silver badges33 bronze badges
It does. I did work around it as you suggest, but was still curious if it was possible. Good to know it's not.
– Trebla
Mar 28 at 18:41
add a comment
|
It does. I did work around it as you suggest, but was still curious if it was possible. Good to know it's not.
– Trebla
Mar 28 at 18:41
It does. I did work around it as you suggest, but was still curious if it was possible. Good to know it's not.
– Trebla
Mar 28 at 18:41
It does. I did work around it as you suggest, but was still curious if it was possible. Good to know it's not.
– Trebla
Mar 28 at 18:41
add a comment
|
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55400584%2fget-list-of-system-properties-from-command-line-only%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown