Simple Steps to Install JavaFX on Linux
Simple Steps to Install JavaFX on Linux
JavaFX is a Java platform for creating and delivering rich Internet applications that can run across a wide variety of connected devices.

Oracle JavaFX 2.0 has been completely re-written and it's installation methods have changed so now you are required to have an integrated development environment (IDE). For example, NetBeans or Eclipse IDE in order to successfully compile and create JavaFX programs.

This tutorial will cover the installation of Oracle JavaFX 2.0 on Ubuntu Linux using the NetBeans IDE.
Steps

Let's start by gathering all your resources. You will need to obtain and install the following for a working implementation of JavaFX 2.0 on your Ubuntu Linux system. Oracle Java JDK/JRE NetBeans IDE Oracle JavaFX SDK

If you don't have Oracle Java installed on your system please see the following article, How to install Oracle Java on Ubuntu Linux. Make sure you have Oracle Java installed on your Ubuntu Linux system. For this project it is imperative that you have Oracle Java and not OpenJDK installed on your system.

You will need to obtain a copy of the NetBeans IDE with JavaFX support and install it to your system. It is best that you obtain the latest copy to ensure it has full support for JavaFX. Make sure you obtain the correct NetBeans IDE for your Ubuntu Linux system architecture, either 32-bit or 64-bit. My suggestion is that you download the NetBeans IDE and copy it to /usr/local and install it by using this method.

How to install NetBeans IDE on your Ubuntu Linux system

Download NetBeans IDE Select and download the NetBeans IDE that has all functionality it is usually the one that is 210MB or more to your Ubuntu Linux system Type/Copy/Paste: cd /home/"your_user_directory"/Downloads Type/Copy/Paste: sudo -s cp -r netbeans-7.1.2-ml-linux.sh /usr/local Type/Copy/Paste: cd /usr/local/ Type/Copy/Paste: sudo -s chmod +x netbeans-7.1.2-ml-linux.sh This will make the Netbeans IDE executable for all users on the system Type/Copy/Paste: ./netbeans-7.1.2-ml-linux.sh Execute in order to install Netbeans IDE to your system

Download JavaFX Beta for Linux, at this time, in order to obtain the JavaFX Beta SDK for Linux, you may be required to create and register an account with Oracle. If you don't you might not be able to obtain the JavaFX Beta 2.0 SDK.

Select the correct JavaFX SDK for your operating system architecture ( 32-bit or 64-bit ) javafx_sdk-2_2_0-beta-b13-linux-i586-13_jun_2012.zip (32-bit) javafx_sdk-2_2_0-beta-b13-linux-x64-13_jun_2012.zip (64-bit)

32-bit instructions Type/Copy/Paste: cd /home/"your_user_directory"/Downloads Type/Copy/Paste: sudo -s chmod +x javafx_sdk-2_2_0-beta-b13-linux-i586-13_jun_2012.zip Type/Copy/Paste: sudo -s cp -r javafx_sdk-2_2_0-beta-b13-linux-i586-13_jun_2012.zip /usr/local

64-bit instructions Type/Copy/Paste: cd /home/"your_user_directory"/Downloads Type/Copy/Paste: sudo -s chmod +x javafx_sdk-2_2_0-beta-b13-linux-x64-13_jun_2012.zip Type/Copy/Paste: sudo -s cp -r javafx_sdk-2_2_0-beta-b13-linux-x64-13_jun_2012.zip /usr/local

Now change into /usr/local and unzip the JavaFX 2.0 SDK in the /usr/local directory on your system.

32-bit instructions Type/Copy/Paste: cd /usr/local Type/Copy/Paste: unzip javafx_sdk-2_2_0-beta-b13-linux-i586-13_jun_2012.zip

64-bit instructions Type/Copy/Paste: cd /usr/local Type/Copy/Paste: unzip javafx_sdk-2_2_0-beta-b13-linux-x64-13_jun_2012.zip

Setting up JavaFX to work with NetBeans IDE Start up NetBeans NetBeans will require you to create a new Java platform that has JavaFX enabled in it. Select File->New Project->JavaFX->JavaFX Application Click Next Click on Manage Platforms->Add Platform It will ask you to point to your installation of Oracle Java which should be /usr/local/java/jdk1.7.0_05 or the directory/location where you have your Java JDK installed. Click Next and Finish, you will notice as soon as you create a new Java platform a small tab named JavaFX will appear. Click on the JavaFX tab Click on enable JavaFX Then fill in the location where you unzipped the JavaFX SDK, which should be /usr/local/javafx-sdk2.2.0-beta

Once you fill in the location of the JavaFX platform location the NetBeans IDE will automatically fill in the rest of the locations for the remaining JavaFX libraries Click Close Make sure you go back to the screen which says New JavaFX application and go to where it says JavaFX platforms and select the Java platform you created with JavaFX enabled. It should say JDK1.7.0 and not JDK1.7.0(Default).

Congratulations, once that task is complete your NetBeans IDE is completely configured for JavaFX development on Ubuntu Linux.

What's your reaction?

Comments

https://wapozavr.com/assets/images/user-avatar-s.jpg

0 comment

Write the first comment for this!