Can't get Eclipse to run with Java FX - java

Alright so basically, I'm trying to run Eclipse with JavaFX, but then it gives me this error:
You are not running your eclipse instance with Java7 or Java8. The JavaFX tooling is disabled because of this.Make Java7/8 the default system java or adjust your eclipse.ini to pass -vm pointing to your Java7/8 install.
In case you want to turn off this check open your preferences and go to General > Startup and Shutdown and uncheck 'JavaFX Tooling Java Check'
Now I know it isn't pointing to the right SDK, but I have no idea how to change it, since I'm kind of new to this this stuff. I've already downloaded JDK 7.40 as well. I'm also using Ubuntu on a virtual machine, if that even matters anyway. Can anyone help me, I'd appreciate it.

Pre-requirements:
Install Java™ 8.
Install Kepler SR2 (4.3.2) .
The Kepler is still not supporting Java8. What to do?
Open Eclipse
Help > Install New Software…
Enter the following URL into the ‘Work with’ field:
http://download.eclipse.org/eclipse/updates/4.3-P-builds/
Press ‘Enter’
Select category ‘Eclipse Java 8 Support (for Kepler SR2)’
Click ‘Next’
Click ‘Next’
Accept Licence Agreement
Click ‘Finish’
Now jre8 is correctly located.
Now configure JavaFx
Open Eclipse
Help > Install New Software…
Enter the following URL into the ‘Work with’ field:
http://download.eclipse.org/efxclipse/updates-released/0.9.0/site
Press ‘Enter’
Select category ‘Eclipse Java 8 Support (for Kepler SR2)’
Click ‘Next’
Click ‘Next’
Accept Licence Agreement
Click ‘Finish’

It looks like the default java on your system is not java7. What do you get when opening a shell and execute java -version? Solution is to:
A) make java7 the default java
B) start eclipse with -vm

Apparently, you have installed 32bit Eclipse and 64bit JRE/JDK on a 64bit OS. Please use 64bit Eclipse and the problem will be solved. Please make sure JAVA_HOME And JRE_HOME is present in environment variables.

I had the same issue. I tried re-installing Eclipse, but it wouldn't work. I had to completely remove the project and delete all the project files. After that, I re-started eclipse and created the project again. However, this time I made sure the project path included the Java FX library as shown in the screen shot.
Java Build Path
I did this while I was creating the project and then I was able to create the project without any issues. Give this a try.

Related

Using the correct JDK or changing default in Netbeans on Linux OS

Disclaimer: I am new to Java, new to Linux, and new to Netbeans - apologies for any over/under explanation - please ask and I will add/remove info.
I have a model written in Java in Netbeans 8.2 that has been successfully running in NetBeans 8.2 on Mac OS. This version of NetBeans was downloaded with JDK8u171 (JDK/Java package).
All components of the model have successfully transferred through FTP (filezilla) to a remote Linux machine.
The Linux machine has a copy of Netbeans 8.2 and has java/1.8.0-oracle (and 1.6.0 and 1.7.0), and has java/1.8.0-openjdk (similarly, 1.6.0 and 1.7.0 also).
I am assuming that 1.8.0-oracle is the equivalent of JDK8u171 but I may well be wrong.
When I load netbeans using
module load java/1.8.0-oracle
module load netbeans
netbeans
The program opens (via remote desktop - x2goclient), and I can search for the project and open it.
Once open, I see:
'myprojectitle (broken)' in the project window on the left of the NetBeans GUI
right click -> resolve problems
...opens a screen saying
'The JDK is missing and is required to run some NetBeans modules Please use the --jdkhome command line option to specify a JDK installation or see http://wiki.netbeans.org/FaqRunningOnJre for more information.'
Does this mean I am using the wrong jdk/java package?
Or is the jdk package configured incorrectly in Netbeans, if so how can I reconfigure?
Any help would be greatly appreciated.
The solution to this was found at
The JDK is missing and is required to run some NetBeans modules
Whereby, java/1.8.0_171 needed to be installed and then netbeans needed to be opened as follows:
netbeans --jdkhome /path/java/1.8.0_171
Apologies for a repeat, but hopefully this answer can either redirect or offer a solution

Missing JRE in Eclipse in Mac OSX

I'm trying to run eclipse on my Mac OS X. I've been doing some Android programming on Eclipse lately, and today wanted to do some development on Java. However, to my surprise, Eclipse says there's no JRE/JDK installed. I don't know how this is possible, since my android projects have worked very well so far, and even now. I've tried the following items:
Checking java version through the Mac terminal. It says java version "1.8.0_20" is installed. Here's the screenshot.
I've checked the Java version through the Java Control Panel in System Preferences. Again, same thing:
I know that when there's no JRE visible in Eclipse, it can be manually entered through the "add" option under preferences > Java > Installed JREs in Eclipse. But although I can find the Contents folder in this path: /Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/home/contents, when I attempt to manually add this in Eclipse, the Java folder under users/library just doesn't show up. I have no idea why this is happening. Here are some screenshots, just in case:
As you can see, the Java folder just doesn't show up under Library in the above screenshot.
Lastly, I've also tried to hit "Search" in Eclipse (same place as "Add" in one of the screenshots above), but "Search" doesn't find anything at all.
I've gone through existing answers on SO which deal with similar problems. The only thing which I haven't done seems to be about setting a path variable, but they were all in Windows OS, so not sure if it applies in my situation.
I'd really appreciate any help on this.
Update 1: According to what has been pointed out so far, I tried copy-pasting the suggested path. But the error I get is: The home directory does not exist.
Here's the screenshot:
You are trying to find the JRE in a wrong Library directory as Library directory maybe present in more than one place. Just copy paste the jre path in 'jre home' input as
/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/home/contents/Home/jre/
EDIT: To find where is your java installed on Mac, run the following command:
echo $(/usr/libexec/java_home)
it should return something like this:
/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home
append jre to the end of this path to build JRE home path:
/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/jre

Why doesn't eclipse notice I have updated Java

I downloaded eclipse but it said I was running the wrong java as in I was running java 6 VM and it required a java 7 VM but I updated to java 7 and re-ran the program and it still said I was running Java 6. Please help, Im probably missing something very simple but don't realize it yet.
You are not setting the java on your project properly.
Right click on your project and choose properties and on the opening dialog choose java build path as picture below
then choose libraries tab and click on you JRE/JDK and hit the edit button to change the JDK/JRE
as picture below
If you have your desired java version in the drop down select that otherwise click on installed JREs and add your desired JRE/JDK path
and then hit OK and save the project.
You should be good after eclipse rebuilds the project

JRE version of my computer

I have two jre in my PC which is running windows 7. When I am running a eclipse project I dont know which version of jre it is calling, so I searched on net for the solution and tried this two things:
In cmd typed java --version and it showed me 1.6.
In control panel, I went it in java control panel and selected java and it showed me 1.7 enabled.
Now, I am confused and how can I change the jre of the system? I want my eclipse project which is running on tomcat to use a specific jre. But I dont know which jre my system is using.
Thanks in advance.
You may check Windows->Preferences->Java->installed to check default JRE that it runs things under.
You may also check property eclipse.vm under the Help->About Eclipse->Installation Details->Configuration.
choose window preferences in eclipse. Select installed jre and add a jre and select an jre you are going to use.
java -version is what a java app on the system will use by default. What IE uses is determined by the extension (Tools->Manage add-ons) you can see the java plugin there.
You can register any jre vesion you want in eclipse using the window->preferences-> installed JRE's
If you are using eclipse, you can set the Java version by going to project->properties->java build path->select the jre version and click on edit.
You can choose the version that you want. Whichever JRE library is displayed in the build path is the version that eclipse is using to compile your code.

Setup eclipse java SE-1.7

I wanted to start learning java but Eclipse is giving me some trouble.
First of all I'm a beginner with Java with little to no knowledge about it. I want to use 'JavaSe-1.7'. I have no clear reason to use it besides using the latest version. After downloading Eclipse (Eclipse IDE for Java Developers) I created a new Java project and selected 'use an execution eviorment JRE : JavaSE-1.7'. This directly popped the notification saying 'The default compiler compliance level for the current workspace is 1.6. The new project will use a project specific compiler compliance level of 1.7.'. I finished creating the project and started following some tutorials.
However I noticed directly I have 2 errors which dont explain anything or have a source. I ignored it and started typing and tried to import 'java.io.console' however it said 'The import java.io cannot be resolved' and I have no idea what is the cause of it neither how to fix this.
Would like some instructions into the right direction.
Thanks in advance
Check your Eclipse preferences: Java -> Installed JREs. The one that you're using should be marked and it should be a JDK not just a JRE.
Also check your project's build path: Right click on the project -> Properties -> Java Build Path
Check in the "libraries" folder whether the JRE System Library is present and if not add it using "Add library"->"JRE System Library" and then select the correct one (from an installed JDK).
You may not have your JDK/JRE set up correctly.
Check the following:
Did you install a JDK or just the JSE? The JDK is needed to compile .java files to .class files. Without it, you can only run java programs, not develop them. If not, download and install it from Oracle website.
Check in Eclipse, if you have the JRE installed there as well. You just need to specify the path to the installation. You can reach this screen via the "Window->Prefrences" menu. see this screenshot:
The message you receive about project specific compiler compliance level is not a problem, it just means that your workspace is set up to comply to java 1.6 but your project will comply to java 1.7 standards. Also, Java 7 in general is no problem whatsoever.
Paths may differ, especially if you're not running a *nix OS. Just point the location to where you installed your JDK.

Categories

Resources