启动 Scala 解释器时“拿起 JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26074446/
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-08-11 01:48:11  来源:igfitidea点击:

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

javascalaubuntu

提问by corazza

When running the Scala interpreter in Ubuntu 14.04, I get the following message printed as the first line:

在 Ubuntu 14.04 中运行 Scala 解释器时,我将以下消息打印为第一行:

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

Followed by the familiar "Welcome to Scala" message.

随后是熟悉的“欢迎使用 Scala”消息。

I'm worried because I haven't seen that when running Scala before - what does it mean, is it dangerous, etc?

我很担心,因为我之前在运行 Scala 时没有看到过 - 这是什么意思,它是否危险等?

Apparently the environment variable $JAVA_TOOL_OPTIONSis set to -javaagent:/usr/share/java/jayatanaag.jar- I didn't set that, but what did and why? Can I safely unset it?

显然环境变量$JAVA_TOOL_OPTIONS设置为-javaagent:/usr/share/java/jayatanaag.jar- 我没有设置,但是是什么以及为什么?我可以安全地取消设置吗?

Additional info:

附加信息:

  • recently installed Android Studio
  • The word "ayatana" in the JAR's name might point to Ubuntu's project Ayatana
  • 最近安装的 Android Studio
  • JAR 名称中的“ayatana”一词可能指向 Ubuntu 的项目Ayatana

采纳答案by Kim Stebel

You can disable jayatana just for the current shell session by unsetting JAVA_TOOL_OPTIONSlike so:

您可以通过如下取消设置来仅为当前的 shell 会话禁用 jayatana JAVA_TOOL_OPTIONS

unset JAVA_TOOL_OPTIONS

That way it will still be enabled for applications needing it.

这样,它仍然会为需要它的应用程序启用。

回答by Richard Wеrеzaк

This occurs if you have installed jayatana which allows the hidden global menu in eclipse to work with Unity:

如果您安装了 jayatana,它允许 eclipse 中隐藏的全局菜单与 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.

将 JAR 放在/usr/share/java/启动时由 JVM 回显的文件夹中。

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_OPTIONSis not set.

并重新启动您的会话,以便JAVA_TOOL_OPTIONS不设置环境变量。

回答by Naeem Iqbal

On Windows, set JAVA_TOOL_OPTIONS=

在 Windows 上,设置 JAVA_TOOL_OPTIONS=

Setting to null will remove it from the environment.

设置为 null 会将其从环境中删除。

回答by Gobinath

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.

这是因为 Jayatana,它被添加到 Ubuntu 15.04 以便为 Java Swing 应用程序启用全局菜单。您可以通过在终端中输入以下命令来安全地删除此消息。此命令将删除 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

但是,删除此选项将禁用 Java Swing 应用程序(如 Netbeans、IntelliJ IDEA)的全局菜单支持。我在这篇文章中分享了我在不丢失全局菜单的情况下抑制消息的解决方法:Java 应用程序的全局菜单支持

回答by KuzyaTheBrownie

If you don't want to uninstall anything you can create a key store from a terminal:

如果你不想卸载任何东西,你可以从终端创建一个密钥库:

keytool -keystore clientkeystore -genkey -alias anyalias

(you should create it at project's forlder)

(您应该在项目的文件夹中创建它)

And then in Android Studio click Build->Generate Signed APK and choose created keystore.

然后在 Android Studio 中点击 Build->Generate Signed APK 并选择创建的密钥库。

回答by Nithin

If you are using Windows OS, goto environment variables and delete or set to null the varible JAVA_TOOL_OPTIONS.

如果您使用的是 Windows 操作系统,请转到环境变量并删除变量 JAVA_TOOL_OPTIONS 或将其设置为 null。