When running the Scala interpreter in Ubuntu 14.04, I get the following message printed as the first line:
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
Followed by the familiar "Welcome to Scala" message.
I'm worried because I haven't seen that when running Scala before - what does it mean, is it dangerous, etc?
Apparently the environment variable $JAVA_TOOL_OPTIONS
is set to -javaagent:/usr/share/java/jayatanaag.jar
- I didn't set that, but what did and why? Can I safely unset it?
Additional info:
If Using Ubuntu 16.04, Check etc/profile there you may find _JAVA_OPTIONS: -Xmx256M set. That's a file where environment variables are set for the whole. I assume you are facing this message for every java application you run. Although there are other ways to set environment variables.
There is a JAVA_TOOL_OPTIONS environment variable, that can be set in the /etc/profile. d for all users.
Remove _JAVA_OPTIONS on Windows: 1) Open the Start menu and enter the phrase "System" in the search, open the program with the same name. 3) In the two lists, check whether there is _JAVA_OPTIONS, when you find a highlight variable and click "Delete." Save your changes by clicking on OK.
You can use _JAVA_OPTIONS to pass options to any JVM process started on your system. For example, set _JAVA_OPTIONS=-Dsun.java2d.noddraw=true. When a JVM starts, it parses the value of _JAVA_OPTIONS as if the parameters were at the command line of java. You can see the passed parameters via JVisualVM.
You can disable jayatana just for the current shell session by unsetting JAVA_TOOL_OPTIONS
like so:
unset JAVA_TOOL_OPTIONS
That way it will still be enabled for applications needing it.
This occurs if you have installed jayatana which allows the hidden global menu in eclipse to work with Unity:
sudo add-apt-repository ppa:danjaredg/jayatana sudo apt-get update sudo apt-get install jayatana
that puts JARs in the /usr/share/java/
folder which is echoed by the JVM when starting up.
If you remove that software, you will not see the message:
sudo apt-get remove jayatana
You may have to delete:
/usr/share/upstart/sessions/jayatana.conf
and restart your session so that the environment variable JAVA_TOOL_OPTIONS
is not set.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With