Possible to write command properties in a file
I need to run a Java programme with JMX feature, so the command would be similar like :
java -Dcom.sun.management.jmxremote.port=10200
-Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.password.file=jmxremote.password -Dcom.sun.management.jmxremote.access.file=jmxremote.access
this makes the command line too long, is it possible to write the properties in a file, in order to shorten the command?
Or any other solutions will be welcome!
java command-line arguments jmx
add a comment |
I need to run a Java programme with JMX feature, so the command would be similar like :
java -Dcom.sun.management.jmxremote.port=10200
-Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.password.file=jmxremote.password -Dcom.sun.management.jmxremote.access.file=jmxremote.access
this makes the command line too long, is it possible to write the properties in a file, in order to shorten the command?
Or any other solutions will be welcome!
java command-line arguments jmx
You could create a link or.bat
-file for launching your application.
– Hulk
Jan 2 at 9:35
add a comment |
I need to run a Java programme with JMX feature, so the command would be similar like :
java -Dcom.sun.management.jmxremote.port=10200
-Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.password.file=jmxremote.password -Dcom.sun.management.jmxremote.access.file=jmxremote.access
this makes the command line too long, is it possible to write the properties in a file, in order to shorten the command?
Or any other solutions will be welcome!
java command-line arguments jmx
I need to run a Java programme with JMX feature, so the command would be similar like :
java -Dcom.sun.management.jmxremote.port=10200
-Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.password.file=jmxremote.password -Dcom.sun.management.jmxremote.access.file=jmxremote.access
this makes the command line too long, is it possible to write the properties in a file, in order to shorten the command?
Or any other solutions will be welcome!
java command-line arguments jmx
java command-line arguments jmx
edited Jan 2 at 10:41


iamrajshah
521820
521820
asked Jan 2 at 9:29


vincent zhangvincent zhang
199211
199211
You could create a link or.bat
-file for launching your application.
– Hulk
Jan 2 at 9:35
add a comment |
You could create a link or.bat
-file for launching your application.
– Hulk
Jan 2 at 9:35
You could create a link or
.bat
-file for launching your application.– Hulk
Jan 2 at 9:35
You could create a link or
.bat
-file for launching your application.– Hulk
Jan 2 at 9:35
add a comment |
1 Answer
1
active
oldest
votes
You can use property file (management.properties) which contains all the JMX options as shown below.
com.sun.management.jmxremote.port=10200
com.sun.management.jmxremote.authenticate=false
com.sun.management.jmxremote.ssl=false
....
But you have to tell where the JMX properties are available for the JVM by
java -Dcom.sun.management.config.file=c:management.properties
Thank you Ramesh, would I know that if this file locate in Eclipse project, where I should place? In resources folder by default?
– vincent zhang
Jan 2 at 13:54
You can keep it anywhere, if you want to keep the file along with the the eclipse project workspace , you can use -Dcom.sun.management.config.file=${workspace_loc:JMXTest/src/com/jmx/test}/management.properties , where JMXTest is my project & com.jmx.test is my package
– Ramesh Subramanian
Jan 2 at 14:31
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/3.0/"u003ecc by-sa 3.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%2f54003940%2fpossible-to-write-command-properties-in-a-file%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
You can use property file (management.properties) which contains all the JMX options as shown below.
com.sun.management.jmxremote.port=10200
com.sun.management.jmxremote.authenticate=false
com.sun.management.jmxremote.ssl=false
....
But you have to tell where the JMX properties are available for the JVM by
java -Dcom.sun.management.config.file=c:management.properties
Thank you Ramesh, would I know that if this file locate in Eclipse project, where I should place? In resources folder by default?
– vincent zhang
Jan 2 at 13:54
You can keep it anywhere, if you want to keep the file along with the the eclipse project workspace , you can use -Dcom.sun.management.config.file=${workspace_loc:JMXTest/src/com/jmx/test}/management.properties , where JMXTest is my project & com.jmx.test is my package
– Ramesh Subramanian
Jan 2 at 14:31
add a comment |
You can use property file (management.properties) which contains all the JMX options as shown below.
com.sun.management.jmxremote.port=10200
com.sun.management.jmxremote.authenticate=false
com.sun.management.jmxremote.ssl=false
....
But you have to tell where the JMX properties are available for the JVM by
java -Dcom.sun.management.config.file=c:management.properties
Thank you Ramesh, would I know that if this file locate in Eclipse project, where I should place? In resources folder by default?
– vincent zhang
Jan 2 at 13:54
You can keep it anywhere, if you want to keep the file along with the the eclipse project workspace , you can use -Dcom.sun.management.config.file=${workspace_loc:JMXTest/src/com/jmx/test}/management.properties , where JMXTest is my project & com.jmx.test is my package
– Ramesh Subramanian
Jan 2 at 14:31
add a comment |
You can use property file (management.properties) which contains all the JMX options as shown below.
com.sun.management.jmxremote.port=10200
com.sun.management.jmxremote.authenticate=false
com.sun.management.jmxremote.ssl=false
....
But you have to tell where the JMX properties are available for the JVM by
java -Dcom.sun.management.config.file=c:management.properties
You can use property file (management.properties) which contains all the JMX options as shown below.
com.sun.management.jmxremote.port=10200
com.sun.management.jmxremote.authenticate=false
com.sun.management.jmxremote.ssl=false
....
But you have to tell where the JMX properties are available for the JVM by
java -Dcom.sun.management.config.file=c:management.properties
answered Jan 2 at 10:52
Ramesh SubramanianRamesh Subramanian
536320
536320
Thank you Ramesh, would I know that if this file locate in Eclipse project, where I should place? In resources folder by default?
– vincent zhang
Jan 2 at 13:54
You can keep it anywhere, if you want to keep the file along with the the eclipse project workspace , you can use -Dcom.sun.management.config.file=${workspace_loc:JMXTest/src/com/jmx/test}/management.properties , where JMXTest is my project & com.jmx.test is my package
– Ramesh Subramanian
Jan 2 at 14:31
add a comment |
Thank you Ramesh, would I know that if this file locate in Eclipse project, where I should place? In resources folder by default?
– vincent zhang
Jan 2 at 13:54
You can keep it anywhere, if you want to keep the file along with the the eclipse project workspace , you can use -Dcom.sun.management.config.file=${workspace_loc:JMXTest/src/com/jmx/test}/management.properties , where JMXTest is my project & com.jmx.test is my package
– Ramesh Subramanian
Jan 2 at 14:31
Thank you Ramesh, would I know that if this file locate in Eclipse project, where I should place? In resources folder by default?
– vincent zhang
Jan 2 at 13:54
Thank you Ramesh, would I know that if this file locate in Eclipse project, where I should place? In resources folder by default?
– vincent zhang
Jan 2 at 13:54
You can keep it anywhere, if you want to keep the file along with the the eclipse project workspace , you can use -Dcom.sun.management.config.file=${workspace_loc:JMXTest/src/com/jmx/test}/management.properties , where JMXTest is my project & com.jmx.test is my package
– Ramesh Subramanian
Jan 2 at 14:31
You can keep it anywhere, if you want to keep the file along with the the eclipse project workspace , you can use -Dcom.sun.management.config.file=${workspace_loc:JMXTest/src/com/jmx/test}/management.properties , where JMXTest is my project & com.jmx.test is my package
– Ramesh Subramanian
Jan 2 at 14:31
add a comment |
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%2f54003940%2fpossible-to-write-command-properties-in-a-file%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
You could create a link or
.bat
-file for launching your application.– Hulk
Jan 2 at 9:35