How to install JavaFx in Ubuntu 12.04?
Solution 1:
Automatically: (via webupd8 helper ppa repository)
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
Note: You can replace
oracle-java7-installer
withoracle-java8-installer
ororacle-java9-installer
. You will need to accept the Oracle End User License Agreement prior to installation (this isn't required with OpenJDK, so if a OpenJDK back-port is released for 12.04, please update this post! :)
Manually:
- http://www.wikihow.com/Install-JavaFX-on-Ubuntu-Linux
Solution 2:
You can try setting the CLASSPATH
instead of PATH
. Java tries to load it's classes from the locations referenced by CLASSPATH
.
- First check your existing classpath with
echo $CLASSPATH
. LikePATH
, the entries forCLASSPATH
are separated with:
(colon). The presence of a.
entry underCLASSPATH
meansjava
can always load classes from current directory. - To add a
.jar
library to yourCLASSPATH
you should open the file~/.profile
and addexport CLASSPATH=$CLASSPATH:path to .jar
to it. Like in your case it should bejavaFx_home=/home/anto/javafx/rt/lib/jfxrt.jar
export CLASSPATH=$CLASSPATH:$javaFx_home
if.
was not present in your previousCLASSPATH
entry then modify the last line asexport CLASSPATH=$CLASSPATH:$javaFx_home:.