Java 7 - Mac + Eclipse - java

I've got an eclipse java project I need to open and run, it was built in Java 7, the default on my mac is appearing as java 6. When I right click the project > build path > try to change the java version .. it says Java 7 (unbound).
I've got java 7 update 51 installed on the mac.
I've tried installing java 7, but eclipse isn't recognising it.
Does anyone know of a solution?

Click that "Installed JREs" button and all will become clear.
Assuming that you have successfully installed an Oracle JDK 7 for Mac, you should be able to configure Eclipse to use that JRE. Here is my setup (using JDK 7u51):

Eclipse does not automatically find all Java instances, but has a list of known JREs.
To add your newly installed JRE, open Preferences, select the Java/Installed JREs page, and try search to find your new engine. If search does not yield results, select the Add... button, on the first page, select Standard VM, and then add '/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home' as the Java home (or something similar).

Related

How can i use eclipse 2020-09 to develop java 8 projects?

I am a regular IntelliJ user, but most of my co-workers use Eclipse. A lot of them say the latest version of Eclipse "2020-09", which requires a JRE "higher than Java 8" in order to run, cannot be used to develop projects requiring JRE8.
This is pretty surprising to me, since I know it is possible to install multiple JDKs and JREs on one machine, I've done it plenty of times.
What is the typical way a person would configure Eclipse 2020-09 (already installed) to work on a project that requires a Java 8 JRE?
JRE 8 apps in eclipse workspace is possible by having the jre 8 jdk. It is true that in order to use eclipse 2020-09 you need java 11+ jdk/jre, but making projects that support jre 8 is still possible.Even I still use 2020-06 and before. Here is a method you could use to get JRE 8 implemented back in your project. Although you can change the defaults, this one will help you change the environment back to java 8 for 1 project.
Right click the library named somthing like "JRE system library[JavaSE-11]". Press properties. This is what you will see JRE System Library chooser image
Choose "Alternate JRE" then click "Installed JREs"Step Image
Press "Add" then you will see 3 options. Choose standard VM. Find your java 8 jdk directory. Usually it is something like C:\Program Files\Java\jdk1.8.0_251.
You can configure the default arguments for your jvm runtime. Then simply hit ok,select the jdk-8 library and close it. Then choose alternate jre again and in the drop-down choose jdk-1.8.0 or some name like that. This will only work if you also have java 8 installed alongside java 11 that is configured properly JDK
You can use Java 11 to start the Eclipse 2020-09 and configure a project to compile with Java 8. The problem is if you want a Eclipse plugin that uses CORBA for example. This module was removed from Java 11 earlier. In this case, I recommend to use Eclipse 2020-06.
Earlier versions of 2020-09 was working with Java 8. I had it, too. Then I updated and I got the same error message like you.
I propose to use an older one or to install JRE 11 and set the JAVA_HOME env variable to it.
The inside the IDE you can set java 8 like an JDK and develope your project with Java 8 while eclipse is running with 11.

Why Eclipse 2018-12 says "No JREs found" in JDK-11?

In Eclipse 2018-12, when the JDK 11 root directory is selected using the search button at Windows -->Preferences--Java--Installed JREs, Eclipse says "No JREs found". But JDK 11 can be added to the list of installed JREs by using the Add button. But when added what appears under the Name column of the Installed JREs box is JDK 11.0.2, not a JRE. When one goes through the search button and the root directory of JDK 8 is selected, the message that says no JREs is not displayed and its JRE is very smoothly added to the installed JREs list. For JDK 11, to be added to the list of installed JREs the Add button has to be used, not the search button. I would like to know what this means?
JDK 11 appears first in the Path variables of the user variables list. After JDK 11, appears JDK 8. Even if Java 11 is returned for the command java -version Eclipse still says no JREs found in JDK 11. In the JDK 11.0.2 root folder, no jre folder is found.
Even though this question is marked as a duplicate, it's not so. This question is about why Eclipse is behaving in a certain way regarding JDK 11 that's different from its behaviour regarding JDK 8.
I have never used the Search button (I always add JREs via the Add button) but I suspect that the button behavior was not updated for JDK 11. Since JDK 9, there is no more jre folder anymore. So, it continues seeking for jre folder and since there is no, it fails.
In any way, I don't see any big reason to use the Search button. Just use the Add button.
The answer to the above question may be found at On Windows, installing Java 11. Part of it is as follows. I now think that the page led to by the link above is not the right answer.
On Windows, installing Java 11 may not fix your problem. The Oracle
Java 11 installer does not appear to register itself as the default
JRE on the system path, or place its entries in the expected location
of the system registry.
As such, even if you plan to use Java 11 in your development
environment, you should consider also installing Java 8 so that your
system path has a JRE/JDK usable as the default for any current or
older Eclipse version.
But why wasn't JDK -11 added to the list of Installed JREs when Eclipse was restarted after Path variables were updated and the command java -version returned java version "11.0..-..."
My question is why didn't anybody knowledgable about this issue didn't reply. Some marked the question as duplicate even.
Go to to your Java folder and check if you've a jre folder inside, otherwise just download JDK again and reinstall.

Installed JRE/JDKs are not shown on Eclipse Mars' Execution Environments

I've just installed Java EE Eclipse Mars, with a JDK 8u45 x64 and JDK 7u79 x64 JDKs. My eclipse.ini file is pointing the -vm option to my Java 8 JDK Home: C:\ambiente_mars\jdk8u45x64\bin\javaw.exe.
When I started Eclipse and was configuring my environment I started to set my Installed JREs like this (and like I've done since Indigo):
My Compiler Settings are configured this way:
After all this, I went to Execution Environments to choose the right VM for all the environments, but my configured JRE's are not there:
Actually, this JRE is not shown for any of the Execution Enviroments <= JSE 1.7. This very same screen, but now on Luna shows everything right, so I think I'm not doing anything wrong.
Maybe this is a bug? Can someone point another way to do it?
Thanks a lot in advance, lads!
Edit 1: Eclipse is x64 too. Thought it would be good to remember ;)
Try this: click "Search.." on item "Installed JREs". Choose your java folder.
Default is: c:\Program Files\Java\
I had this problem while looking into issues with an Eclipse (Neon .1) installation yesterday.
After trying plenty of different things, we spotted that the machine had both the environment variable "JRE_HOME" set to a JRE that wasn't the one running eclipse, and a _JAVA_OPTS (global java settings override) environment variable set. When we took both of these out, the execution environments finally started being found!
Unfortunately, we removed both at once, so I can't say which of the two it was, but it's another thing you could try changing.
First , you have correclty added the JDK(JRE) in your Eclipse , but the execusion environement changes from a project to an other and in the same workspace , that means , you have to right click on your project => Build Path => Configure Build Path => Libraries Tab you will find JRE System library [JDK...] => you click on and you click on Edit button then you can select the installed JDK in your machine.
Also in eclise.ini for eclipse or jbdevstudio.ini for Jboss developper Studio you set the full path of you installed JDK as a default vm
This is an example :
-vm
C:/Program Files (x86)/Java/jdk1.7.0_51/bin/javaw.exe
About the JAVA_HOME you can modify if by making you default JDK.
Hop that is useful for you.
Click on windows → preferences → java → Installed jres
Check jdk with version available or not
If available just tick the jdk checkbox and then goto execution environment and select javaSE version and then Compatible jre section add jdk
If not available click on add → select standard VM → in place of jre home add jdk bin folder path and click on apply → tick on jdk
then goto Execution environments and select javaSE version and then Compatible jre section add jdk

Adding Java ME platform in netbeans 8.0

I am having trouble installing the ME platform for Netbeans 8.0 - I have:
Installed Netbeans IDE 8.0
Installed jmesdk-3.4
Installed the jmesdk-3.4 plugin & activated it in Netbeans
When I try to create a New Java ME > Mobile application project
I get a warning saying
No Java ME Platform found. Please add at least one
When i try to add the java platform by locating the jmesdk-3.4 folder, it tells me no platform was detected automatically(failed) and it requires me to add manually.But adding it manually just creates more confusion.
need help please.
How to install JAVA ME SDK 3.4
Go to the Java ME SDK Download page javame-sdk/downloads/index.html.
Click the Accept License Agreement option.
Create an Account or login
Download the Java ME SDK installer file and save it to any location on your computer.
Double-click the installer file to run the installer, and follow the instructions.
Remember the installations directory. e.g. -> U:\Java_ME_platform_SDK_3.4
When the installation is complete,
the Java (TM) ME Platform SDK Device Manager icon appears in the Windows system tray.
Unzip the downloaded oracle-jmesdk-3-4-rr-nb-plugins.zip to a folder
e.g. oracle-jmesdk-3-4-rr-nb-plugins
How to activate Java ME support in NetBeans IDE?
Choose Tools > Plugins from the main IDE's toolbar.
In the Plugins dialog box, click the Installed tab and select Java ME in the list of available features.
Click Activate.
At the Welcome panel of the Installer dialog box, click Activate.
When the activation is successfully completed, click Finish.
Click Close to close the Plugins dialog box.
How to register Java ME SDK as a platform in NetBeans IDE?
Choose Tools > Java Platforms in the IDE.
In the Java Platform Manager dialog box, click Add Platforms.
In the Add Java Platform dialog box, select Java ME CLDC Platform Emulator and click Next.
Select the folder where Java ME SDK is installed in the Choose directory to search for platforms dialog box and click Open.
Ensure the Java ME SDK platform is chosen in the Add Java Platform dialog box and click Next.
After the IDE detects the platform, click Finish. Java ME SDK should now be registered in the IDE.
In the Java Platform Manager dialog box, click Close.
How to install the downloaded plugin
Go to Tools -- Plugins -- Downloaded
Click Add Plugins
Navigate to the Plugin folder e.g. oracle-jmesdk-3-4-rr-nb-plugins
Select all .nbm
Restart Netbeans
enjoy the new program examples
Done
More Information wiki.netbeans
I heve readed that that can be being caused by the new serialization filter feature in the JDK(Serialization Filtering. Seems that it was added to JDK 8 after the 112 update so on this update of the JDK it shall work but it certainly is possibly to use the Java ME SDK on JDKs with this feature. I did it at least on JDK 1.8.0_192. To this I had to make some changes on the java.security file.
The chages were:
Remove the # on front of jdk.serialFilter
Replace the texto after
jdk.serialFilter to *
Romove the # on front of
sun.rmi.registry.registryFilter property and of it parametres and
remove the whitespaces and / from the same.
Do the same on the
sun.rmi.transport.dgcFilter property.
Append ;* at the last parameter
of sun.rmi.registry.registryFilter
It seems to be importante to not corrupt the parameters because I do this and the emulator wasn't starting.
I tried on JDK 11.0.1 and it don't work.
I did what the other answer recommends, which worked, but only when using Netbeans IDE 7.4 and JDK 1.7 for a 32-bit system (https://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html). Currently using a Windows 10 64-bit system. Note that I did not accept any updates for the required Java ME plugins, as I hear that might make things crash.

Downloaded Eclipse and also downloaded Java SE Development Kit 7 but cannot get a new project in Eclipse to work?

I downloaded eclipse and it wouldn't open at all, then I went and downloaded Java SE Development Kit 7 and now Eclipse opens but I still cant get a new project to open where I can mess around with some code. Is it because I have them downloaded into two different locations? I have Eclipse downloaded in:
OS(C):/Program Files(x86)/Eclipse on my laptop and I downloaded the
Java SE Development Kit 7 to OS(C):/Program Files/Java. Any help would
be much appreciated.
Open the Java > Installed JREs preference page. Check the box on the line for the JRE that you want to assign as the default JRE in your workbench. If the JRE you want to assign as the default does not appear in the list, you must add it. Click OK.
and then if you find the right jre at place,then close the eclipse welcome page.
Then go the File option at top left corner then new and then select Java Project and it should work.
File>>New>>Java Project

Categories