解决ubuntu中JDK的Picked up JAVA_TOOL_OPTIONS提示问题。_coderbean的博客-程序员秘密

有时间我会翻译成中文的
Java swing applications' menus do not integrate with Ubuntu's global menu until Ubuntu 15.04. A library called Jayatana 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 <file-name>

 

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.
 
 
原文地址:http://www.javahelps.com/2015/06/global-menu-support-for-java.html#remove-jayatana-message
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/coderbean/article/details/47704771

智能推荐

小迪安全视频-学习笔记(收藏)_Rnan-prince的博客-程序员秘密

视频学习笔记 · 语雀https://www.yuque.com/gemaxianrenhm/hahwdw

mysql outer join的用法_MySQL 8 中的连接语法JOIN、OUTER JOIN的相关用法_阿黎和臭屁猪的博客-程序员秘密

JOIN连接为内连接(INNERJOIN),如果A表与B表进行JOIN连接,都是查询这两个表的交集,所谓交集就是这条记录既在A表中存在也在B表中存在:mysql&gt; SELECT a.id, a,name,b.dept from A as a join B as b on a.id = b.em_id如何理解上面表两个表的交集,就是在A表是查找id和name,并在B表中一定能找到一条记录使得...

BAT机器学习面试1000题系列(第1~305题)(二)_weixin_30721899的博客-程序员秘密

记录一些已经看过的题目。https://blog.csdn.net/v_JULY_v/article/details/7812192414 L1和L2正则先验分别服从什么分布。机器学习 ML基础 易 (没太看懂)@齐同学:面试中遇到的,L1和L2正则先验分别服从什么分布,L1是拉普拉斯分布,L2是高斯分布。@AntZ: 先验就是优化的起跑线, 有先验的好处就是可以在较小的数据集中有良好的泛...

公司项目(2):HTTP请求工具类_changhenshui1990的博客-程序员秘密

一:POST public static JSONObject post(String url, JSONObject jsonObj, String token) throws Exception { HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); CloseableHtt...

React-native 安装基础篇_srxboys的博客-程序员秘密

React-native 安装基础篇 RN官方文档 (0.55): - http://facebook.github.io RN 中文翻译 文档 (0.51): - https://reactnative.cn 推荐博客 ES6 语法学习(阮一峰) - http://es6.ruanyifeng.com以下基于MacOS 一...

HBase概念学习(六)java API之HTable与HTablePool_hbase的gettable方法_小弟季义钦的博客-程序员秘密

在HBase中,HTable封装表格对象,对表格的增删改查操作主要通过它来完成,构造方法如下:        HTable table=new HTable(config,tableName);在构建多个HTable对象时,HBase推荐所有的HTable使用同一个Configuration。这样,HTable之间便可共享HConnection对象、zookeeper信息以及Region地

随便推点

并发编程(5)——AQS之CountDownLatch、Semaphore、CyclicBarrier_weixin_30433075的博客-程序员秘密

CountDownLatchA synchronization aid that allows one or more threads to wait until a set of operations being performed in other threads completes.通常情况下,countDown如下调用CountDownLatch countDownLa...

Python之循环绘图_python循环图形_whyfail的博客-程序员秘密

#画圆圈import turtlet = turtle.Pen()my_color = ("red","green","yellow","blue","black")t.width(4)t.speed(6)for i in range(10): t.penup() t.goto(0,-i*10) t.pendown() t.color(my_color...

HBase数据表操作说明_aqjmo的博客-程序员秘密

HBase插入数据说明1创建表用法: create ‘表名’,‘列族1’,‘列族2’hbase(main):007:0&gt; create ‘kooola’,‘cf1’,‘cf2’例如上面的语句就创建了拥有两个列族(cf1、cf2)的表,表名为kooola,注意创建表只需要指定列簇,列簇下边的列名不需要指定。正常来说指定一个列簇就可以。创建表,表名hbase_test,HBase表是由Key-Value组成的,下面给出一个hbase表的格式,方便小伙伴们理解此表有两个列族,列族1和列族2,

potplayer 64位linux,Installation Instructions for Linux_中本姜的博客-程序员秘密

1. Install DirectX 9 in a Windows 2000 bottle. Then install PotPlayer1.5.40688.EXE, followed by PotPlayer1.5.42994Upd.EXE. Later versions do not work, although you may perhaps have success with portab...

Person-reid设计1_制作reid数据集_amazingcode_lyl的博客-程序员秘密

1、创建数据集通过YOLO将视频中的行人检测出来,并创建行人gallery库,进行手工标标签。2、特征提取器训练使用Resnet50或其他好用的分类器训练,使用crossentroy loss3、提取数据集特征向量并存储以npy存储特征向量,省去每次检索时重复提取gallery中的特征4、Reid检索使用Reid中的欧式距离度量,ID loss来提取Rank10的行人,并锁定特定行人5、整体的前端页面设计,设计一个小型的系统...

Pytorch模型flops, params计算_ReLuJie的博客-程序员秘密

thopimport thopfrom torchvision.models import resnet50if __name__ == "__main__": model = resnet50() input = torch.randn(1, 3, 224, 224) flops, params = thop.profile(model, inputs=...

推荐文章

热门文章

相关标签