Search code examples
javajnlpcentos7gnome-3

Launching JNLP from CentoOS 7 Gnome Desktop with PATH


I have a JNLP application that uses the local $PATH variable. It launches and behaves correctly from the web, command line, menu system, and Java control panel. When I launch it from the desktop shortcut on CentOS 7, the $PATH is simply

/bin:/lib:/usr/bin:/usr/lib:/usr/share/bin:/usr/share/lib

regardless of what else I put in the /etc/profile.d/, or ~/.bashrc, or anyplace else that I can find. It only seems to affect CentOS 7. CentOS 6.x, OS X, and Windows all behave normally when launching from their Desktop environments.

I am using Oracle's 32-bit Java 1.8.0_60 on the 64-bit CentOS 7 for specific application requirement reasons. I have uninstalled IcedTea, but still have OpenJDK 1.7 installed, though it is not used by the JNLP application and the alternatives have been configured to use Oracle's.


Solution

  • The best solution that I have found is:

    1. Disable shortcut creation in the Java control panel > Advanced settings
    2. Create a shell script that contains these two lines:
      source /etc/profile
      javaws < location-of-jnlp >
      
    3. Create a .desktop file that calls the shell script

    It's not an ideal solution, but it works for the short run.