"Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar" when starting the Scala interpreter

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.


This is because of Jayatana, which is added to Ubuntu 15.04 in order to enable global menu for Java Swing applications. You can safely remove this message by entering the following command in a terminal. This command will remove the auto-start configuration of Jayatana.

sudo rm /usr/share/upstart/sessions/jayatana.conf

However, removing this option will disable the global menu support of Java Swing applications like Netbeans, IntelliJ IDEA. I have shared my workaround to suppress the message without losing the global menu in this article: Global Menu Support for Java Applications

Tags:

Java

Ubuntu

Scala