有时间我会翻译成中文的

Java swing applications‘ menus do not integrate with Ubuntu‘s global menu until Ubuntu 15.04. A library calledJayatana is available to enable global menu support for Java swing applications in Ubuntu (From Ubuntu 15.04 Jayatana becomes a default library). There are hundreds of articles available about Jayatana, but this article has an additional hack to remove the irritating message, printed by Jayatana.

If you are an Ubuntu 15.04 user, jump here: Remove: Picked up JAVA_TOOL_OPTIONS Message

If you have not noticed any differences between Java swing applications and others, have a look at the following screenshots of Android Studio and Eclipse.

Android Studio without global menu support

Eclipse with global menu

To enable the global menu support, install the Jayatana using following commands in your terminal (Ctrl + Alt + T to start terminal).

sudo add-apt-repository ppa:danjaredg/jayatana

sudo apt-get update

sudo apt-get install jayatana

Once you have successfully installed the software, logout and login to the system again. Now open any Java swing application, you will see the difference.

Remove: Picked up JAVA_TOOL_OPTIONS Message

Now open your terminal and enter the following command to check the version of Java.

java -version

You will get a message “Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar” just above the version information of Java. This message irritates me a lot, and confuses my students whenever I show practical demonstration to them in terminal. If this message does not bother you, simply ignore the rest of this article and spend your time in reading any other articles in this site.

The “Picked up JAVA_TOOL_OPTIONS” message can be removed by a simple hack, but with a cost of disabling automatic support of Jayatana for all the Java applications. Lets dirt your hands...

Step 1:

Enter the following command in the terminal to remove the “ Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar” message of Jayatana.

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

Now logout and login to the system and execute the same command to print the version of Java.

java -version

This time you will not get that annoying message. But, if you run any Java swing application, it will be returned to its old swing menu. Now you need to enable the global menu support for all the Java swing applications manually.

Step 2:

IntelliJ IDEA & Android Studio:

To enable the global menu support of Android Studio, enter the following command in terminal. In my case the Android Studio is installed in /opt/android-studio/ directory. Change the given command based on the location of your Android Studio or IntelliJ IDEA.

For Ubuntu 32bit:

sudo gedit /opt/android-studio/bin/studio.vmoptions

For Ubuntu 64bit:

sudo gedit /opt/android-studio/bin/studio64.vmoptions

At the end of the opened file, add the following line and save the file.

-javaagent:/usr/share/java/jayatanaag.jar

After the modification, the file should look like this:

NetBeans:

To enable the global menu for NetBeans, enter the following command in the Terminal. In my case the NetBeans is installed in /usr/local/netbeans-8.0.2 directory. Change the location in this command, based on the version and location of your NetBeans.

sudo gedit /usr/local/netbeans-8.0.2/etc/netbeans.conf

Search for netbeans_default_options in the opened file, and add the following statement at the end of the existing value. (Notice that the options are separated by space)

-J-javaagent:/usr/share/java/jayatanaag.jar

After the modification, the file should look like this:

Step 3:

Close the file and open your IDE (Android Studio/IntelliJ IDEA or NetBeans), you will see the magic.

For any Java swing applications, use the following command to enable the global menu integration.

java -jar -javaagent:/usr/share/java/jayatanaag.jar

If you are using any other Java swing applications, change the configuration file of them by adding the command line parameter ‘-javaagent:/usr/share/java/jayatanaag.jar‘ to enable the global menu.

picked up java_tool_options:_解决ubuntu中JDK的Picked up JAVA_TOOL_OPTIONS提示问题。相关推荐

  1. 解决ubuntu中vi不能正常使用方向键与退格键的问题

    解决ubuntu中vi不能正常使用方向键与退格键的问题 方案一: 问题: ubuntu中vi在编辑状态下方向键不能用,还有回格键不能删除等我们平时习惯的一些键都不能使用. 解决办法: 可以安装vim ...

  2. matlab ubuntu 显示乱码_解决Linux中Matlab中文乱码问题

    解决 Linux 中 Matlab 中文乱码问题 由于 Linux 下 Matlab 的图形界面是用 Java 写的,所以只要搞定 Java 的中文显 示就行了. 1 . 我 Matlab2007a ...

  3. idea 模块jdk依赖总是自动变_解决IDEA中导入新的maven依赖后Language Level自动重置问题...

    问题: 弄了个测试项目,因为有涉及JDK1.8的代码,所以将IDEA中默认的Language Level 5(即对应JDK1.5),修改为了8(即对应JDK1.8),但是每次引入新的maven依赖,自 ...

  4. python光标变粗_解决IDEA中不能正常输入光标变粗的问题

    解决IDEA中不能正常输入光标变粗的问题 遇到的问题 解决方法 win7: insert键切回 win10: fn+insert切回 Mac: fn+i 切回 到此这篇关于解决IDEA中不能正常输入光 ...

  5. ubuntu chrome java插件_在Ubuntu中为Chrome安装Java插件

    问题描述 我有JDK,在Ubuntu中一切正常,我是说IDE,一些应用程序,我能够开发和运行项目,但是我在Chrome中收到一条消息:Java(TM) is required to display t ...

  6. 解决ubuntu中vi不能正常使用方向键与退格键的问题 - 部分按键无法正常使用 按键乱码...

    本人以前一直使用redhat和fedora,没用过ubuntu,感觉很不适应,没办法,研发部都用ubuntu,我也只好随大流,安装ubuntu了 发现 ubuntu中vi的方向键和退格键总是不能正常使 ...

  7. 解决Ubuntu中vi命令的编辑模式下不能正常使用方向键和退格键的问题

    在Ubuntu中,进入vi命令的编辑模式,发现按方向键不能移动光标,而是会输出ABCD,以及退格键也不能正常删除字符.这是由于Ubuntu预装的是vim-tiny,而我们需要使用vim-full,解决 ...

  8. [Zotero] 解决ubuntu中zotero:// 链接跳转无法工作的问题

    在Ubuntu中安装zotero可以直接在官网下载linux版本 ​官网链接 安装教程参考 但是通过官网进行安装会出现链接无法跳转的情况 解决方法 在官方的安装说明文档中,选使用deb方式安装 链接: ...

  9. python字符串拼接数字_解决Python中字符串和数字拼接报错的方法

    解决Python中字符串和数字拼接报错的方法 前言 众所周知Python不像JS或者PHP这种弱类型语言里在字符串连接时会自动转换类型,如果直接将字符串和数字拼接会直接报错. 如以下的代码: # co ...

最新文章

  1. linux ls命令 --time-style选项 日期时间格式控制
  2. Spring入门详细教程(三)
  3. Scrum 团队成立 -- 软件工程
  4. vue Iframe
  5. Express框架开发知识点总结
  6. Linux系统Shutdown命令定时关机详解
  7. jQuery表单校验
  8. 最后期限 软件工程_如何在软件开发的最后期限内实现和平
  9. android游戏编程之从零开始_纯C语言程序员写的编程新手入门基础小游戏之最炫酷推箱子...
  10. Qt文档阅读笔记-Broadcast Sender Example与Broadcast Receiver Example解析
  11. react 组件添加样式_如何通过4个简单的步骤将CSS模块样式表添加到React组件
  12. ImportError: No module named six
  13. Mac使用sdkmanager从官网下载新版android SDK
  14. vue切换路由的时候,如何让右侧滚动条滚动到顶部呢?
  15. eclipse在debug启动时无法启动解决办法
  16. 华为p20如何连接计算机,华为P20 USB调试和开发人员选项的打开方法(EMUI8.1)
  17. 全新V10抢单系统唯品会/京东/淘宝自动抢单区块系统源码
  18. android微信分享怎么自定义样式,微信更新!主题皮肤终于支持自定义了,样式超多有个性...
  19. idea2022版将idea中的Web项目部署到Tomcat中(详细图文步骤)
  20. PCIE-XPDMA-Simple DMA传输笔记

热门文章

  1. Elasticsearch:跨集群复制 Cross-cluster replication(CCR)
  2. 华熙LIVE·五棵松商业北区明年国庆亮相 互动体验升级
  3. 【复盘】2022年度复盘
  4. 运放放大倍数计算公式_电源经典运放电路,加法器,减法器,同向放大器,反向放大器...
  5. pyqt5 源码 eric 记录
  6. few-shot learning个人总结
  7. 勾股定理的证明(转载)
  8. [海边的卡夫卡.pdf
  9. 神器如 dnSpy,无需源码也能修改 .NET 程序
  10. L3-012 水果忍者