IBM Worklight - .war builder using wrong Java version - java

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.

Related

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.

Eclipse Eclipse is running under 1.6, but 1.7 is needed

I have just installed WindowBuilder for Eclipse and java 1.7 JDK, but when I create a new JFrame in Eclipse, and try to open the "design-view" in WindowBuilder I get the following error: "Eclipse is running under 1.6, but the Java project has a 1.7 Java compliance level, so WindowBuilder will not be able to load classes from the project. Use a lower level of Java for the project, or run Eclipse using a newer Java version."
How to Resolve Incompatible Java version Error in Eclipse in mac?
You might have installed the Java 1.7 SDK but it looks like Eclipse is started with the older one (1.6).
The WindowBuilder is integrated into Eclipse and will use the same Java instance as Eclipse (that is the 1.6 version).
However your project will use Java 7. The WindowBuilder (Java 6) will be unable to load classes from the higher version which your project uses (Java 7).
What you need to do is:
Configure your eclipse to start with the newer (Java 7) version. This can be done in the Eclipse.ini file.
Which Eclipse you're running?
You definitely need to upgrade your Eclipse to a newer x64 Version to use Java 1.7.0

how to configure JDK as the default JVM in my workspace

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

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.

How to change workspace JRE in Eclipse

While creating new Java project in Eclipse I got following warning "The current workspace uses 1.4 JRE..."
I have JRE7 on my system. I have added following lines in eclipse.ini
-vm
C:\Java\jre7\bin\javaw.exe
I have added JRE7 to Installed JREs through Windows -> Preferences-> Installed JREs.
Still under Compiler tab I can see only compiler compliance level till 6.
How can I change workspace JRE to JRE 7 ?
Java 7 support is only available since Eclipse Indigo SR1 (released about a month ago). So, upgrade Eclipse.
I also have jre7, and it really doesn't matter if it only says that is compliant with 1.6, because the project will look for the java compiler specified by the jre/jdk used in the project.
I also recommend you use the jdk instead of the jre, and set the environment variable JAVA_HOME, there's lots of tutorials on this in Google.
The issue where it is compiling with 1.4 but the workspace Preferences Compiler setting is 1.6 seems to be the issue described in this bug:
Bug 499675 - Global compiler settings ignored after restarting, defaults to 1.4 even though 1.8 displayed
https://bugs.eclipse.org/bugs/show_bug.cgi?id=499675
where the workaround is to change the workspace setting to a different version number and then back to 1.6. That would enable the workspace to compile with 1.6.
To compile with 1.7 you'd need to upgrade eclipse as in BalusC's answer.

Categories