Resolves the picked up java_tool_options of the JDK in Ubuntu.

Source: Internet
Author: User
Tags netbeans

There is time I will translate into Chinese Java swing applications ' menus do not integrate with Ubuntu's global menu until Ubuntu 15.04. A Library Calledjayatana is available-enable global menu support for the Java swing applications in Ubuntu (from Ubuntu 15. Jayatana becomes a default library). There is hundreds of articles available about Jayatana, but this article have an additional hack to remove the irritating Message, printed by Jayatana.
If you is an Ubuntu 15.04 user, jump here:Remove:Picked up java_tool_options Message

If you had not noticed any differences between Java swing applications and others, with a look at the following screensho TS of Android Studioand 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 has successfully installed the software, logout and login to the system again. Now open any Java swing application and you'll 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'll get a message "Picked up java_tool_options:-javaagent:/usr/share/java/jayatanaag.jar" Just above the version inf Ormation 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 all other Artic Les 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/jayata Naag.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'll not get the that annoying message. But, if you run any Java swing application, it'll be the returned to their old swing menu. Now, 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 for Android Studio, enter the following command in terminal. In my case the Android Studio was 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 are installed in /usr/local/netbeans-8.0.2Directory. 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 Existin G value. (Notice that options is 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'll see the magic.


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

java -jar -javaagent:/usr/share/java/jayatanaag.jar <file-name>

If you is using any other Java swing applications, change the configuration file of them by adding the command line param Eter ' -javaagent:/usr/share/java/jayatanaag.jar' To enable the global menu. Original address: Http://www.javahelps.com/2015/06/global-menu-support-for-java.html#remove-jayatana-message

The

Resolves the picked up java_tool_options of the JDK in Ubuntu.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.