Remove annoying environment variable JAVA_TOOL_OPTIONS

78

This is because you have installed jayatana that enables global menu support for Java swing applications in Ubuntu. There are few ways of doing this:

Option 1: Remove jayatana package

sudo apt-get remove jayatana

If you do not need global menu support for Java swing applications, you can simply remove the package. Removing the package will not cause more harm than making menus of java swing based applications such as eclipse and intellij move back inside the window of the application.

Option 2: Remove only the annoying message

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

This will remove the auto-start configuration of Jayatana and you won't see the annoying message ever. Again, this will disable the global menu support of Java Swing applications.

If you want to still get enable the global menu support without getting the message, you can refer to this page. In summary:

For IntelliJ IDEA & Android Studio:

#For 32-bit Ubuntu, assuming Android studio is installed in /opt/android-studio/ 
sudo gedit /opt/android-studio/bin/studio.vmoptions 

# For 64-bit Ubuntu, assuming Android studio is installed in /opt/android-studio/ 
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

For NetBeans:

Assuming NetBeans is installed in /usr/local/netbeans-8.0.2

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) and close it.

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

Related videos on Youtube

Klaudia A
Author by

Klaudia A

Updated on September 18, 2022

Comments

  • Klaudia A
    Klaudia A over 1 year

    I need to create a string like this: 01-2--3---4----5-----6------7------- for a let n=7, using a loop. I've created something like this so far:

    let numbers = '';
    n = 7;
    
    for(i=0; i<=n; i++) {
    numbers += i;
    if (i>0) {
    numbers += ('-')
    }}
    

    which gives me: "01-2-3-4-5-6-7-". Don't know how to change the code so that it could multiply the number of '-' equal n in every loop.