Possible to write command properties in a file












2















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!










share|improve this question

























  • You could create a link or .bat-file for launching your application.

    – Hulk
    Jan 2 at 9:35
















2















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!










share|improve this question

























  • You could create a link or .bat-file for launching your application.

    – Hulk
    Jan 2 at 9:35














2












2








2








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!










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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



















  • 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












1 Answer
1






active

oldest

votes


















2














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






share|improve this answer
























  • 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













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
});


}
});














draft saved

draft discarded


















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









2














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






share|improve this answer
























  • 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


















2














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






share|improve this answer
























  • 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
















2












2








2







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






share|improve this answer













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







share|improve this answer












share|improve this answer



share|improve this answer










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





















  • 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






















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

Npm cannot find a required file even through it is in the searched directory