3

I recently installed Oracle JDK 1.8 on my Kubuntu Linux machine following this guide. I did the manual install because I couldn't get the easy one to work.

If I've understood correctly, javafx should be included on the default classpath after installing Oracle JDK 1.8. This is not the case for me: I need to manually add the jfxrt.jar file to the classpath for each new project.

Java -version in terminal gives:

java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

How can I fix this so that jfxrt.jaris always on the default classpath?

Sifu
  • 33
  • 1
  • 1
  • 4

1 Answers1

1

You need to set up CLASSPATH in /etc/environment. Execute the following command in a terminal (Ctrl+Alt+T)

sudo gedit /etc/environment

Add the following lines (all four lines at the end of /etc/environment)

JAVA_HOME="/usr/lib/jvm/oracle_jdk8"
export JAVA_HOME
CLASSPATH="/usr/lib/jvm/oracle_jdk8/lib"
export CLASSPATH

Alternatively you can add CLASSPATH to /etc/profile.d/oraclejdk.sh if you have used this guide.

export CLASSPATH="/usr/lib/jvm/oracle_jdk8/lib"
Faizan Akram Dar
  • 4,569
  • 1
  • 25
  • 31