如何抑制“Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar”消息

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30213807/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 16:41:08  来源:igfitidea点击:

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

javaubuntu

提问by Koushik Chandra

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:

我使用的是 Ubuntu 15.04 和 Java 1.7。更新到 15.04 后,每当我键入任何 Java 命令时,都会收到如下消息:

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?

我怎样才能抑制这种行为?

采纳答案by Dmitry Ginzburg

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

我也升级到 Ubuntu 15.04 并遇到了同样的问题(不过,我不觉得这是个问题)。

$ 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 ayatanais trying to attach its agent to all started Java code.

从这个输出我可以得出结论,有些东西ayatana正试图将它的代理附加到所有启动的 Java 代码中。

Ubuntu Wikisays, that

Ubuntu Wiki说,

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

Ayatana 是一项集体努力,旨在改善 Ubuntu 中和适用于 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:

消除此变量的简单方法是将其取消设置~/.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

回答by Swaddo

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

Ron 在 askubuntu 上有一个完整的答案,我引用

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.

选项 1:删除 jayatana 包

sudo apt-get remove jayatana

如果您不需要 Java Swing 应用程序的全局菜单支持,您可以简单地删除该包。删除包不会比使基于 java swing 的应用程序(如 eclipse 和 intellij)的菜单移回应用程序窗口内造成更大的危害。

选项 2:仅删除烦人的消息

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

这将删除 Jayatana 的自动启动配置,您将永远不会看到烦人的消息。同样,这将禁用 Java Swing 应用程序的全局菜单支持。

The entire solution is available here

整个解决方案在这里可用