I'm trying to deploy the app with a .jsp file, which I figured is the reason I get an error because other projects without .jsp files have no problem.
When I try to deploy the app, I get the error : "Cannot get the System Java Compiler. Please use a JDK, not a JRE"
I tried resolving the problem using Mahmoud's solution here : Google app engine deployment : JDK not JRE
But once I have changed the eclipse.ini file, I launch Eclipse and get this error : "Version 1.7.0_80 of the JVM is not suitable for this product. Version 1.8 or greater is required"
You need to install JDK8 or JRE8 for Eclipse to execute and JDK7 for compile this application to build.
As mentioned in the error, JDK7 is not compatible with Eclipse. So you need to set your system JDK to 8 for Eclipse. Alternatively, you could instead modify the environment variables or startup script for Eclipse to reference JDK8 and avoid making this a system wide change.
Although for security purposes, I do recommend using the latest JDK/JRE as the system one for most cases.
Then within Eclipse, set the project JDK to 7.
Click through the following:
Windows -> Preferences -> Java -> Installed JRE
There you can remove the "JRE System Library", then you can add and configure another already installed JRE/JDK for this specific project.
You need the JDK for building which includes a JRE, but for deploying you only need the JRE.
The JDK includes the ability to compile Java source into executable code, where as the JRE can only execute that executable code.
You can download JDK from Oracle's site here: Oracle Java JDK 8
Related
I am new with programing and i wanted to install netbeans in my macbook but i kept having this text " The JDK is missing and is required to run some NetBeans modules Please use the --jdkhome command line option to specify a JDK installation or see http://wiki.netbeans.org/FaqRunningOnJre for more information.”
That means you need the Java Development Kit (JDK). It is important for running files and develop those. You can download the newest version of the JDK under: https://www.oracle.com/java/technologies/javase-downloads.html
If you already have a JDK installed you must change the config file of NetBeans.
I'm trying to install a java extension as a jar file. When I have just Oracle Java version 8 installed, I can run the jar-file.
However, when I download Eclipse, it includes openjkd7 and somehow this messes up my Java installation. When I include the jar file and try to run, I get:
Exception in thread "main" java.lang.UnsupportedClassVersionError:<path> Unsupported major.minor version 52.0
What is going on? Is Eclipse using a different version of Java? How can this be resolved?
I think you need to do the following things :
a.) Set the JAVA_HOME, probably should be the 1.8 version. Quit all instances of Eclipse.
b.) Re-open Eclipse. Then, In Eclipse, configure the Eclipse project Build Path to the 1.8...it SHOULD be the default JRE/JDK in Eclipse now, but it's hard to say since your installed Eclipse with a bundled JRE/JDK.
Right-click on the Eclipse project.
Build Path > Configure Build Path > Libraries (Tab) > Choose the JDK you want.
You can also configure Alternate versions of JRE/JDK from the screen...
I have both Net-beans and eclipse IDEs installed in my laptop, But there is a per-devolved system that want lower version of JDK. so I installed net-beans older version too. but then JDK does not support my eclipse version. can I use two JDK in once?? and what should I do for working in both IDE in different versions.
Eclipse / Net beans need JRE to run in first place. If the version of JRE you install is not supported by the version of Eclipse/Netbeans u have, then you have to get a compatible version of Eclipse/Netbeans that match your installed JRE. (Alternatively you can change the JRE version)
Now coming to JDK. You need JDK only to compile you code inside Eclipse/Netbeans. You can have any number of JDKs installed and you can configure 'per project'.
In Eclipse, this is how you configure the JDK for the project
Java Build Path -> Libraries -> Add Libraries -> JRE System Library
In the next screen you add the desired JDK from your system , by locating it in the file browser.
P.S : Havent used Netbeans, but sure it is supported
I have a Java Application on Eclipse using jdk1.7.0_72
I am having an issues when running a project from a runnable jar, the application works perfectly when ran from Eclipse. The application uses a cacert which for some reason fails when I use the runnable jar. What I have noticed is that the java version of the runnable jar is different when I run it from Eclipse. This is causing issues.
Here is a snippet of the system properties when I run from Eclipse:
**sun.boot.library.path=C:\Program Files\Java\jdk1.7.0_72\jre...
java.vm.version=24.72-b04
java.runtime.version=1.7.0_72-b14
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs=C:\Program Files\Java\jdk1.7.0_72\jre…
java.library.path=C:\Program Files\Java\jdk1.7.0_72\bin…**
Here is a snippet of the system properties when I run from JAR:
**sun.boot.library.path=C:\Program Files\Java\jre7\bin
java.vm.version=24.75-b04
java.runtime.version=1.7.0_75-b13
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs=C:\Program Files\Java\jre7\lib\endorsed
java.library.path=C:\Program Files\Java\jre7\bin;C:\Win…**
How can I make the JAR use the same version that Eclipse uses?
Also when I run java -version I get this:
"1.7.0_72"
When I click on About Java, I get this:
"1.7.0_75-b13"
If you run a JAR it'll use the Java version you set up on the PATH variable. If you run it from Eclipse you can tell Eclipse which version to use. As you can see the library.path variable is different, so you're loading a different Java in each case.
You can either set the proper Java version in the PATH variable or set it in Eclipse in the Preferences - Java - Installed JRE's menu.
It looks like you have at least two Java version installed on your machine.
Java 1.7.0_72-b14 is configured in your Eclipse
Java 1.7.0_75-b13 is configured in your PATH
You can change the java in your environment system variables according to this guide:
https://docs.oracle.com/javase/tutorial/essential/environment/paths.html
You are most definitely using different JRE's.
You have both the JDK and the JRE installed. It just so happens that the JDK has an internal JRE which you can see in the first line:
**sun.boot.library.path=C:\Program Files\Java\jdk1.7.0_72\jre...
The JRE is installed here
C:\Program Files\Java\jre7\bin
Your best option is to point Eclipse to execute your JAR using the installed JRE since the other option is to require the JAR to use the Eclipse JDK/JRE which would be problematic if you wanted to distribute the JAR to machines that didn't have Eclipse installed.
In Eclipse you can designate multiple JRE's and name them, create a new one and give it this path, then you can go to your project's run options and tell it to use this library when running your JAR.
"The java version of the runnable jar" cannot be different because of different execution environments: it's the JVM version.
The issue is that the jar is compiled with an higher version than the execution environment.
In the Eclipse IDE:
in Window/Preferences go to Java/Installed JREs
add your 1.7.0_72-b14 JRE
check the newly added JRE as the default for the workspace
Clean/recompile the project an re-export the jar file with File/Export/jar file
I have Java 8 and I've been trying to use a JAR package that uses JRE 6.
In 'Create a Java Project' I used the 'Use a project specific JRE' and also
created a run configuration but when I try to set the alternate JRE to 6, the 'run' button gets blocked out. Are they not compatible or am I missing a step? I've also tried changing the PATH destination, though I'm not sure if that is even relevant to my problem.
EDIT: I am using a JAR package from an online source that is Java 6 compatible and am trying to integrate it into Eclipse Mars with Java 8 installed.
A few items to check, under Project settings: (most of these can be set workspace-wide as well)
Java Build Path > Libraries. Replace JRE System Library with a jdk6 execution environment or alternate JRE
Java Compiler > JDK compliance. Set to 1.6
System:
Check Installed JREs and Execution environments. Make sure a JRE is linked to the Execution Environment for JavaSE-1.6 (with the checkbox).
Did you try just adding the external JAR to the project? Most (non-executable) JARs that were originally made for older versions of java should still work today.
To add an external JAR: right-click on your project in the package explorer and go to Build Path >> Add External Archives... then select your JAR from there. Be sure to leave the project set up for JRE8.
The reason that your run button is blocked out when you switched to JRE6 was because Eclipse detected that it was not installed and therefore cannot run it as JRE6.