how to configure JDK as the default JVM in my workspace - java

Im trying to create a new grails project using the IDE GGTS (groovy and grails tool suite )
but it says that grails needs a JDK and JRE is not enough , I already installed JDK 1.7 and added the JAVA_HOME to the path
i also copied the grails folder and added a GRAILS_HOME to the path
in GGTS :
i tried In Window>Preferences>Java>Installed JREs to check JDK1.7.0_51
and
In Window>Preferences>Java>Installed JREs>Execution Environments I choosed JavaSE-1.7 and checked JDK1.7.0_51[perfect match]
the JDK installed is 64 bits and My PC is windows 8 64 bits
but the error persists

We have to make sure that the Java run time of our eclipse IDE points to a JDK instead of a JRE. Here are the steps:
Go to Window->Preferences
Edit Installed JRE if it is pointing to a JRE installation
Change it to the JDK installation directory. It is better if you also change the name

Related

Eclipse on Mac uses wrong JDK

I've got two JDKs on my Mac, 1.8 and OpenJDK 11. I have this line in my .profile:
export JAVA_HOME=$(/usr/libexec/java_home -v 11)
In a terminal, java -version shows it's using 11, and echo $JAVA_HOME also points to 11.
I have set Preferences/Java/Installed JREs to 11. I have set the compliance level to 11 in the compiler config in my pom.
Eclipse, however, shows the "JRE System Library" in my project to be 1.8. When I execute a class in the project, it runs under 1.8.
What gives? Is there a secret setting on the Mac telling Eclipse to use 1.8? Or a secret setting in the Eclipse config?
(I'm using the latest version of Eclipse, 2018-09, fully up-to-date.)
Update: Per #vshcherbinin's comment, the Run Configuration/Java Application/JRE tab says "Project execution environment 'JavaSE-1.8' (Home)". I do not believe I have any project-specific settings. I deleted the .project, .classpath, and .settings in the project and re-imported the basic Maven project. Not sure how to make the project execution environment default to 11.

Xamarin - VS 2015 - looking for jdk1.7.0_71 - java.exe

I have just installed Xamarin into my existing VS2015. I have a Win 7 64 bit machine. When I start a simple Xamarin.Forms project and try to build and deploy onto an Android emulator, it throws an error -
"The specified task executable location "C:\Program Files (x86)\Java\jdk1.7.0_71\bin\java.exe" is invalid."
In Options->Xamarin->JDK Settings = "C:\Program Files (x86)\Java\jdk1.8.0_91\"
I have uninstalled JDK 1.7 from my machine, and restarted my machine. There is no difference.
I also have a 64 bit version of JDK and my JAVA_HOME points to that, which I cannot change just for Xamarin.
Where in the world is Xamarin picking up this path from?
How to fix this issue?
I had this problem too and I solved it deleting the file sdks.cache.
You will find it in the folders OBJ (Debug or Release) and BIN (Debug or Release) of your project.
This file contains some variables configuration. This problem is because the node is targeting to wrong path (C:\Program Files (x86)\Java\jdk1.7.0_71).
Deleting the file is safe because it will be regenerated again with the next build but in this time will use your Xamarin configuration to set node with the configured path.
I hope this help you to solve your problem.
I had a similar problem when I had both versions of Java installed in my system (1.7 and 1.8). Despite Xamarin -> JDK settings pointing to 1.8 version, the error
specified task executable location "C:\Program Files (x86)\Java\jdk1.7.0_71\bin\java.exe" is invalid
was still displayed.
This issue can be resolved by following the steps below:
Uninstall Java 1.7
In Microsoft visual studio, click on the solution (in solution explorer) right click and select "Clean"
Ensure your Xamarin -> JDK settings point to Java 1.8 version
Rebuild the solution
Java installed version and Xamarin referred different version .. Please config correct Java version in the Xamarin In Options->Xamarin->JDK Settings.
Thanks
Xamarin.Android currently requires 32-bit Java JDK 7 (1.7). The latest version is 1.7 update 79.
Xamarin.Android also requires that a 32-bit Java JDK 7 (1.7) be installed. Later versions of the JDK can also be installed alongside JDK 7, if required by your machine.

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

IBM Worklight - .war builder using wrong Java version

I've setup Worklight Studio to use JDK 1.6 in my Worklight project.
I also changed the "compilation compliance level" to 1.6.
Eclipse is started with jdk/jre 1.6.
Despite all of this, the war is generated with Java 1.7!!!
My JAVA_HOME and JRE_HOME variables are also set to my JDK/JRE 1.6.
I'm operating under Windows 7 (64 bit).
How can I tell Worklight to build the war with jdk 1.6, not the default Windows one?
In Eclipse, navigate to Window > Preferences > Java > Installed JREs. Make sure JRE v6 is the version that is to be used (also try to remove and re-add it, maybe it's some stuck configuration option...).
This is the JRE version Eclipse will use to generate the .war file in your Worklight project.
For good measure, delete your existing .war file before generating a new one after changing the above.

Grails requires jdk

I have installed several jre's and jdk's on my computer.
Today I set up grails version 2.3.4.
I have downloaded and installed the grails plugin on a new eclipse kepler.
However, when I start eclipse I get:
How to change to an jdk in eclipse?
I appreciate your answer!
UPDATE
As you can see the jdk should be properly configured:
you have to set the path of the eclipse-vm to a jdk (i.e. the vm with which eclipse is started) in the eclipse ini like described here.

Categories