• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to install JavaFx in Ubuntu 12.04?

 
Anto Aravinth
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I downloaded the javafx from the homepage and I wish I could put into my classpath. So in Ubuntu I did this :


vi ~/.bashrc


opened the file and added the following lines :


JAVAFX_HOME=${HOME}/javafx/rt/lib/jfxrt.jar
export PATH=$PATH:$JAVAFX_HOME

provided that I have downloaded my JavaFx into my ${HOME}/javafx/ directory!

And I did this as well :

echo $PATH

which ouptputs :


/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/anto/javafx/rt/lib/jfxrt.jar


But when I run my JavaFx program using Groovy like this :

groovy HelloWorld.groovy

I get an error like this :

Caught: java.lang.NoClassDefFoundError: javafx/application/Application
java.lang.NoClassDefFoundError: javafx/application/Application
Caused by: java.lang.ClassNotFoundException: javafx.application.Application


Where I went wrong? Kindly help me out. I'm facing this problem for a day!
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The jfxrt.jar has to be part of the CLASSPATH and not PATH.
 
Anto Aravinth
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply. So, can you say me how to setup the CLASSPATH in Ubuntu? Sorry, I'm very new to Ubuntu.
 
Darryl Burke
Bartender
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://docs.oracle.com/javase/1.3/docs/tooldocs/win32/classpath.html
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can follow the same approach you used for PATH. Create a CLASSPATH variable and then export it.
Or you can try the -cp command line switch and mention the dependent jars,class files there. More details are in the link which Darryl provided.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic