Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to configure java in unix to always add a JRE parameter whenever java is run? e.g.

share|improve this question
up vote 4 down vote accepted

You can create a wrapper script and add it to your path. Something like this


java "$@"  

Call it 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'
share|improve this answer
+1 Recommend double-quoting $@ to preserve arguments in the face of whitespace. (Sorry, I'd have edited that in myself, but I have repeatedly, comically, and miserably failed the CAPTCHA.) – pilcrow Aug 18 '12 at 15:02

IBM java has support for a 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;

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.

share|improve this answer

You could create an alias

alias java='java'

You could also play around with Application Resource Files which may be more appropriate.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.