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

时间:2022-09-29 17:07:19

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_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?

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

Additional info:

附加信息:

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

6 个解决方案

#1


28  

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

您可以通过取消设置JAVA_TOOL_OPTIONS来禁用当前shell会话的jayatana,如下所示:

unset JAVA_TOOL_OPTIONS

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

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

#2


27  

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在启动时由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_OPTIONS is not set.

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

#3


6  

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应用程序的全局菜单支持

#4


2  

On Windows, set JAVA_TOOL_OPTIONS=

在Windows上,设置JAVA_TOOL_OPTIONS =

Setting to null will remove it from the environment.

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

#5


0  

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)

(你应该在项目的forlder上创建它)

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

然后在Android Studio中单击Build-> Generate Signed APK并选择created keystore。

#6


0  

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

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

#1


28  

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

您可以通过取消设置JAVA_TOOL_OPTIONS来禁用当前shell会话的jayatana,如下所示:

unset JAVA_TOOL_OPTIONS

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

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

#2


27  

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在启动时由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_OPTIONS is not set.

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

#3


6  

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应用程序的全局菜单支持

#4


2  

On Windows, set JAVA_TOOL_OPTIONS=

在Windows上,设置JAVA_TOOL_OPTIONS =

Setting to null will remove it from the environment.

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

#5


0  

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)

(你应该在项目的forlder上创建它)

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

然后在Android Studio中单击Build-> Generate Signed APK并选择created keystore。

#6


0  

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

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