Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to suppress "Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar" message

Tags:

java

ubuntu

I am using Ubuntu 15.04 and Java 1.7. After updating to 15.04, whenever I type any Java command, I get a message like:

Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar

For example:

hduser@ubuntu:~$ java -version
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

How can I suppress this behavior?

like image 667
Koushik Chandra Avatar asked May 13 '15 11:05

Koushik Chandra


2 Answers

I also upgraded to Ubuntu 15.04 and had the same problem (though, I didn't feel it as a problem).

$ echo $JAVA_TOOL_OPTIONS
-javaagent:/usr/share/java/jayatanaag.jar
$ apt-cache search jayatana
jayatana - Java Native Library for ayatana project

From this output I can conclude, that something ayatana is trying to attach its agent to all started Java code.

Ubuntu Wiki says, that

Ayatana is a collective effort to improve the user experience of software in and for Ubuntu.

So, it looks like this application is attaching agent to ensure application to be stable or something like this.

The easy way of eliminating this variable is just unsetting it in ~/.profile:

$ echo unset JAVA_TOOL_OPTIONS >>~/.profile

But this looks more like workaround and if you're sure you don't need this application, you can fully remove it:

$ sudo apt-get remove jayatana
like image 174
Dmitry Ginzburg Avatar answered Nov 15 '22 17:11

Dmitry Ginzburg


There is a complete answer by Ron over on askubuntu and i quote

Option 1: Remove jayatana package

sudo apt-get remove jayatana

If you do not need global menu support for Java swing applications, you can simply remove the package. Removing the package will not cause more harm than making menus of java swing based applications such as eclipse and intellij move back inside the window of the application.

Option 2: Remove only the annoying message

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

This will remove the auto-start configuration of Jayatana and you won't see the annoying message ever. Again, this will disable the global menu support of Java Swing applications.

The entire solution is available here

like image 24
Swaddo Avatar answered Nov 15 '22 16:11

Swaddo