Ubuntu – After installation, Netbeans 10.0 won’t run from Ubuntu 18.04 desktop

18.04jdknetbeans

I have Netbeans 10.0 installed on Ubuntu 18.04 in the /opt/netbeans directory.

Netbeans 10.0 was installed just by extracting from zip file incubating-netbeans-10.0-bin.zip downloaded using the command:

sudo wget http://mirrors.wuchna.com/apachemirror/incubator/netbeans/incubating-netbeans/incubating-10.0/incubating-netbeans-10.0-bin.zip

After extraction you will find netbeans folder under /opt directory. Issue the following extract command:

sudo unzip ~/Downloads/incubating-netbeans-10.0-bin.zip -d /opt/

After Netbeans extracted into /opt/netbeans directory, a shortcut file netbeans.desktop was created, edited and then installed at /usr/share/applications/ directory by the following command:

sudo desktop-file-install netbeans.desktop

The contents of netbeans.desktop is:

Contents of netbeans.desktop

The installed Java version on the desktop is JDK11

Java HOME

I have put Netbeans binary on PATH by running export PATH=$PATH:/opt/netbeans/bin using ~/.bashrc script file

Netbeans PATH

  1. When I click on the Netbeans icon on my desktop, there is just a flicker and the IDE never appeared and nothing happened

    Netbeans Icon

  2. Nevertheless, when I run netbeans in a terminal, I get the following output

    Netbeans Running

    WARNING: An illegal reflective access operation has occurred
    WARNING: Illegal reflective access by org.netbeans.swing.plaf.gtk.ThemeValue (jar:file:/opt/netbeans/platform/modules/org-netbeans-swing-plaf.jar!/) to method javax.swing.plaf.synth.SynthStyle.getColorForState(javax.swing.plaf.synth.SynthContext,javax.swing.plaf.synth.ColorType)
    WARNING: Please consider reporting this to the maintainers of org.netbeans.swing.plaf.gtk.ThemeValue
    WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
    WARNING: All illegal access operations will be denied in a future release
    

Can somebody be kind enough to throw some light on this issue?
Thanks in advance.

Best Answer

It seems that the value of Exec in the desktop entry a.k.a. the "shortcut" contains an error. According to Desktop Entry Specification:

The Exec key must contain a command line. A command line consists of an executable program optionally followed by one or more arguments. The executable program can either be specified with its full path or with the name of the executable only. If no full path is provided the executable is looked up in the $PATH environment variable used by the desktop environment. The name or path of the executable program may not contain the equal sign ("=").

Also, UBUNTU_MENUPROXY looks like a user-defined variable which doesn't work in Desktop Entries. So, better remove that and provide the absolute path of NetBeans, i.e.,

Exec=env /opt/netbeans/bin/netbeans #You can also omit "env"
Related Question