Eclipse doesn't find my java 8 library (mac) - java

I have installed java 8 SDK on my mac and terminal says java -version is
java version "1.8.0_11"
Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)
bur when i create a project in eclipse with JSE 1.8 this is what happens:
as you can see, no library is assigned:
when i try to add a new environment, this is what i get:
any help or suggestions?

You need to select the home, eg /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home

The link to your Java 8 environment must be broken. Go to Window, Preferences, search "jre", select Installed JREs, and create a new environnment. Give the path to a JDK rather than a JRE. Then, right click on your project, Properties, Build path, Edit the current JRE and replace it with the new one.
You will also need to right click on your project, Properties, Java compiler, and set the compiler compliance to 1.8.

I have Eclipse Luna 4.4 on my Mac OSX 10.10 and I was having the same issue. I was able to resolve it by going to Preferences -> Java -> Installed JREs and "Add" the path to JRE home in the JDK: (/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre). That did it

Related

I can see java 11 when I am checking version through command prompt but why it's showing java 17 when I am checking version in Eclipse

its showing below details while checking 'java -version' in CMD
java version "11.0.15" 2022-04-19 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.15+8-LTS-149)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.15+8-LTS-149, mixed mode)
I am getting below response in Eclipse while using 'System.getProperty("java.version")'
Java Version is: 17.0.2
The CMD uses the PATH environment variable to search for executables (java.exe). The executable is searched in the directories listed in that variable, in the given order. The first one found, is the one that is executed.
Eclipse uses its own settings:
the JRE used to start Eclipse can be specified in the eclipse.ini file; if not specified there, the OS default will be used (usually the same as the CMD, see above);
the JRE used to execute an application inside Eclipse, is specified by the Run/Debug configurations (Run-Run Configurations.../Run-Debug Configurations...), the respective project properties (Project-Properties) and Eclipse preferences (Window-Preferences-Java-Installed JREs).
When I chose "Use Default Workspace JRE" inside Java Build Path->JRE System Library it is showing Java 11.0.15 in eclipse

Change JDK Home on Netbeans 8.2

Recently I copied Netbeans 8.2 to new computer and unfortunately the java path are different from previous. My machine running on Windows 10 x64. And when I running netbeans64.exe on bin folder than two popups appear
cannot locate java installation in specified jdkhome:C:\Users\root\Workspace\root\idk\java\jdk\1.8\bin\
After that, I choose to use default version, than another popup appear
cannot find java 1.8 or higher
I've follow instruction to change on /etc/netbeans.conf as below
netbeans_jdkhome="C:\Users\root\Workspace\root\idk\java\jdk\1.8\bin\"
But it doesn't works. I can assuring you that inside the folder contains java.exe which is version 1.8
java version "1.8.0_152"
Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)
I had registered that path above on System Environment Variables
I have tried to use parameter --jdkhome but still got the same result.
What wrong with my Netbeans? Any other suggestion?
Thanks
jdkhome should point to the root of the JDK folder, not the bin folder inside it.
So it should be:
netbeans_jdkhome="C:\Users\root\Workspace\root\idk\java\jdk\1.8\"
or
--jdkhome C:\Users\root\Workspace\root\idk\java\jdk\1.8

SDK error message on IntelliJ IDE

I am new to this community and have this problem:
I downloaded the IntelliJ IDEA IDE for Windows (x64) and i can not run a single line of code, there always comes the error message:
Cannot start compiler: the SDK is not specified for module "XY".
Specify the SDK at Project Structure dialog.
I followed the instructions on their Website and downloaded the SDK for Windows x64 here.
Now I used to set up everything, but it doesn't work as planned. In fact it is the same error as before.
I am glad for any help, thanks! :)
First make sure you have installed JDK on your system. Open the command line and type: java -version.
You should get something like:
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
Then open your project in IntelliJ IDEA and go to Project Structure → Project tab (Ctrl+Alt+Shift+S on Windows OS) and add new JDK by providing its local path like C:\Program Files\Java\jdk1.8.0_60:

java - how can I have both versions 1.6 and 1.7 at the same time (osx)?

I have legacy code that uses jruby that needs java 1.6
My current setup is:
$ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
08:42:11 mdurrant C02MH2DQFD58 /Users/mdurrant
$ ruby --version
jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on
Java HotSpot(TM) 64-Bit Server VM 1.6.0_65-b14-462-11M4609 [darwin-x86_64]
Now I want to use eclipse and the latest version requires the jdk version 1.7
How can I add that and then have them co-exist?
I'm worried that this will effectively upgrade my existing 1.6 to 1.7 (the newer gives me lots of memory issues in my apps - yeah that's as backwards as it sounds, the newer version being worse at memory management - probably due to how our apps are built).
Install as a default JRE from Java Build Path -> JRE System
Library -> Installed JRES -> Add ...
or
You can specify JDK version for usage with Eclipse in eclipse.ini. This will resolve problem with starting Eclipse.
-vm // Add this configuration before -vmargs.
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin/java
or You can install jenv
jenv is for a equivalent of rbenv, but for Java environnement. It allow to easily switch between several JDKs installations (already presents), and configure which one to use per project.
Install or specify as a default JRE in eclipse from Java Build Path -> JRE System Library -> Installed JRES -> Add .
otherwise specify the default Jdk file in eclipse.ini configuration file

Build path specifies execution environment J2SE-1.4. error in eclipse

In building eclipse code, I have this "Build path specifies ..." error.
Build path specifies execution environment J2SE-1.4. There are no JREs installed in the workspace that are strictly compatible with this environment.
Googling to find this post : java build path problems to add J2SE-1.4 execution environments.
And checked Java SE 7 is installed correctly.
However, I still get the error. What might be wrong?
I have this information with java -version in my command line.
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)
You can try to go to Project|Properties, then Choose the Java Build Path,
chose the current JRE System Library, and choose Remove.
Select Add Library, and under the JRE System Library category, select your system library;
try to choose the Workspace default JRE
You can try going into Preference|Java|Installed JREs. Click on Add... button. "Add JRE" page opens and select-Standard VM. On "Add JRE" page, next to "JRE Home",click on button "Directory". Under page "Browse for folder", find Program Files-> Java and find folder with JRE version e.g if the message said JRE 1.6 missing add the folder location JRE 1.6 in it like -> C:\Prgram Files\Java\jdk1.6_30

Categories

Resources