Why doesn't eclipse notice I have updated Java - 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

Related

!how to enable workspace window and view projects in eclipse for java?

I created a few projects but now I don't know how to view and also I don't see any menu bar! I used to have work space,what might be wrong? please help.
EDIT : I already mentioned I am not even able to see menu bar! so, no window or no FILE dropdown also! the eclipse is just opening and i can add project and other save print button are disabled, apart from save,forward backward disabled buttons , I am not able to see anything?! what to do?
Also actually I have installed two JRE's and I have eclipse and eclipse for java ee also on the same machine, i recently installed java ee eclipse and jre 1.7 for some requirement, earlier I used to work with just eclipse and jre 1.8. I am not even java developer, but for some course, i need to install 1.7 jre and eclipse java ee! Now what might be the problem?
You may have accidentally switched your workspace.
Go to File->Switch Workspace to check your recent workspaces, and change it back.
go in window menu and click on reset perspective and if your project are still not seen then try to switch the workspace to the drive in which it is saved

Error message when opening a file

I just got a java project from a friend of mine but whenever i go to open it in net beans i get an error message saying that
"Problem: the project uses the java platform called JDK_1.6 but this platform was not found
solution: click resolve and create new platform called JDK_1.6"
can anyone help me open the project?
Do you have the Java JDK 1.6 installed? If not, you have to change the java platform version (in the properties of the java project). Or you install Java JDK 1.6 ;)
You have two choices.
You Could
Download and install Java JDK 6
In Netbeans, goto Tools > Java Platforms. Click [Add Platform], Select [Java Standard Edition] and click [Next], Browse to the location that you have installed Java 6 JDK to and select [Finish]. You should then be able to name the platform if you wish.
Or You Could
Right click the project node, select [Properties]. Under the "Source" category, make souce that the Source/Binary Format is JDK 6. Under the "Libraries" category, select the default JDK from the Java Platform combobox or change it to whatever you want.

Can't get Eclipse to run with Java FX

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.

How do I upgrade Java Compiler?

I'm using JCreator to work with Java. I got this exception (or maybe error?) it says the following:
major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
I downloaded the last version of Java SE, but that didn't work.
By the way, Java files compile fine and also run without any problem. But I have downloaded a file that my instructor has upload with many java classes and this message appears when I try to run the class that has the main method.
I've never used JCreator, but a little bit of Googling gave me this page of JCreator installation instructions, which has the following instructions for manually setting the JDK that JCreator uses:
Starting JCreator Without Using the Setup Wizard
With JCreator active, open the Options window from the Configure menu.
Click the JDK Profiles option.
Click the default item in the list, and click Edit.
Ensure that the Name field shows the correct version of the selected JDK directory; in this case, JDK version jdk1.6.0. [ That's a typo I think ... ]
Set the JDK Home path by clicking the Browse button next to this field.
Browse to the root directory of the JDK installation: C:..\jdk1.7.0. Click OK.
Click the Documentation tab, and Add the path: C:..\jdk1.7.0\docs. Click OK.
Close the windows.
Yours is a slightly different scenario, but I think these instructions should also work for changing the JDK for an existing installation of JCreator.
(Use the pathnames of your latest JDK installation ... obviously.)

Eclipse - Just uninstalled Java 1.7 (still have Java 1.6 on my machine), but now Eclipse won't recognize any java stuff

I'm extremely confused about how to set up Java on Eclipse. I don't get how classpath/system variables/etc all works. I set my Java compiler settings from 1.7 to 1.6 after I uninstalled 1.7 (I still have 1.6). But it's still not working. Any help?
Open Eclipse. Follow Project => Properties => Java Build Path.
Come onto Libraries tab and on the right hand side you will see some buttons, click Add Library.
Select JRE System Library and click "Next" button. By clicking on Installed JREs button you will see the JREs that your Eclipse recognizes. If the JRE version is not visible there, you can use "Add" button to add a new JRE, and make sure you set the path of new JRE correctly. Sample path on my machine: C:\Program Files (x86)\Java\jre6
Probably you have to set up classpath: http://javarevisited.blogspot.com/2011/01/how-classpath-work-in-java.html, or may be you have only JRE (not JDK)?

Categories

Resources