Call it java-local.sh or some other fancy name and just use it in place of the java binary. Of course this one is pretty basic but I am sure it caters for like 90% of the cases. As a shell exercise, you could make it an alias for your user (but then it only works for your user):
# alias java='java -Dcom.sun.management.jmxremote.port=25800'
IBM java has support for a SystemDefault.properties file, where each line specifies one Java system property or command line option. but I can't see anything similar for the oracle JDK, and there is a similar thread gone unanswered here; https://forums.oracle.com/forums/thread.jspa?threadID=2131751
stracing openjdk during startup, seems to indicate that it does not look for any ".properties" files, so I am guessing that the answer is no. But there might be a Java expert come along with a better answer.
You can create a wrapper script and add it to your path. Something like this
Call it java-local.sh or some other fancy name and just use it in place of the
java
binary. Of course this one is pretty basic but I am sure it caters for like 90% of the cases. As a shell exercise, you could make it an alias for your user (but then it only works for your user):You could create an alias
You could also play around with Application Resource Files which may be more appropriate.
IBM java has support for a
SystemDefault.properties
file, where each line specifies one Java system property or command line option. but I can't see anything similar for the oracle JDK, and there is a similar thread gone unanswered here;https://forums.oracle.com/forums/thread.jspa?threadID=2131751
stracing openjdk during startup, seems to indicate that it does not look for any ".properties" files, so I am guessing that the answer is no. But there might be a Java expert come along with a better answer.