Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent java from outputting JAVA_TOOL_OPTIONS to stderr [duplicate]

Tags:

java

rhel

I'm using _JAVA_OPTIONS to set some defaults for Java on RHEL. It works fine but now every time I start java I get the following message

Picked up _JAVA_OPTIONS: -foo -bar -baz

is it possible to keep the options but suppress the display of this message.

like image 955
Carcophan Avatar asked Nov 22 '22 22:11

Carcophan


1 Answers

From looking at the relevant source code (arguments.cpp in openjdk, line 2492), there is no way to control the output of this message.

The only thing I could say is that it is printed to stderr. So you could wrap your commands to redirect stderr to /dev/null (if there wasn't anything else you cared about on stderr).

  • Or write a java wrapper script which filtered out this message.
  • Or submit a feature request to the openjdk project, although this won't solve your immediate problem.
like image 101
jtahlborn Avatar answered Nov 25 '22 12:11

jtahlborn