• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

How to install JavaFx in Ubuntu 12.04?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://docs.oracle.com/javase/1.3/docs/tooldocs/win32/classpath.html
 
Mohamed Sanaulla
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic