TechnologY

Migrating to #Java8 with #JavaFx

Migrating to Java8 from previous Java versions.

Steps to be followed:

  1. For Eclipse users: Install a SR2 version 4.3.2 of Kepler which was released on 26th Feb 2014.
  2. Install java8.
  3. Change the Environment variable (you will need administrative rights to perform this step)
    For Windows 7:

i.    Click Start

ii.    Right Click Computer

iii.    Click Properties

iv.    Click on Advanced System Settings on top left column

v.    Under Advanced tab, click on Environment Variables

vi.    Under System Variables look for “JAVA_HOME”

vii.    Select it and click edit

viii.    Change the value from the previous jdk version to “Java\jdk1.8.0”

ix.    Save the changes by clicking “Ok”

At this point of time, we have changed the overall variables for Java in our computer. Now we have to change the local variables in our project.

  1. Open EclipseSR2 and choose your default workspace where your previous Eclipse was pointing. Hence, it will automatically fetch your projects to EclipseSR2.
  2. Now we have to change the local variables.
    1.  Project-> Properties->
      Select Java Build Path from left column
      Under Libraries tab search for JRE System Library [JavaSE-1.7]. Version may be different in your case. Double click it.
      Edit Library will open.
      Under System Library click “Installed JREs…”
      Installed JREs would be shown here.

Click Add-> JRE Type opens-> Standard VM-> Click next
Under JRE home: provide you jre8 folder
In my case it is C:\Program Files (x86)\Java\jre8
JRE name: any variable name would do but following the best practices write “jre8”.
Now we should be able to see all the library files in the blank column “JRE system libraries”. Click “Finish
Select jre8 from the installed java runtime environment and click ok.

Select “Alternate JRE:” from the options and select jre8. Click finish. Now the JRE System Library [JavaSE-1.7] should change to JRE System Library [jre8].

  1. Change other build paths. In my case I have to upgrade javaFx file.
    Look for the previous build path and update with the new one.
    Double click the library and click Variables.
    It was by default would look like “C:/Program Files (x86)/Java/jdk1.7.0_45/jre/lib/jfxrt.jar”.
    Edit it to “C:/Program Files (x86)/Java/jdk1.8.0/jre/lib/ext/jfxrt.jar” and save all the changes.

Now we are ready to build our Java project and it is ready to run.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s