I primarily use JDeveloper 10 with JDK 1.4.2 on Vista. I would like to install Eclipse and have it run the latest JDK 6.
Is this possible without conflict?
Ideally I would like to just use JDeveloper and switch back/forth between JDK versions. Is this possible?
It is indeed possible, you can have as many JDKs in system as you wish.
Just install them into different directories, then you can add a new JDK to your IDE (they support having multiple).
You can choose one on per-project basis.
I am not sure with JDeveloper 10, but in eclipse you can specify which installed JDK you wish you use under window>preferences>Java>Installed JREs.
You can specify the JRE for Eclipse to run under with the -vm command line switch or in eclipse.ini. e.g. -vm "%JAVA_HOME%/bin/javaw.exe"
You can specify the JRE for executed code via the Window:Preferences:Java:Installed JREs menu.
If you select project properties in Eclipse, then Java Build Path, you can choose a different JDK to use when building the project.
Related
Eclipse was so far using the installed jre "jre1.8.0_261". I want eclipse to use jdk. I have changed the eclipse.ini and have added the following :-
-vm
C:\Program Files\Java\jdk1.8.0_191\bin\javaw.exe
Moreover, I have changed the windows preferences with Installed JREs as the one offered by the jdk "jdk1.8.0_191". The java build path has been also aligned to use "jdk1.8.0_191" .
However under the configuration of Eclipse IDE Installation, I could still see that Eclipse is using the previously used jre version as vm.
-vm
C:\Program Files\Java\jre1.8.0_261\bin\server\jvm.dll
However, I want Eclipse only to use the mentioned JDK. Is there any solution to this?
Eclipse can use one Java distribution to run Eclipse, and any Java distribution to compile code with. It can certainly use a different distro to run than it uses to compile code. You can even have different projects using different distros.
It's probably best to have a single "-vm" option in the "eclipse.ini" file, which specifies the latest version of Java (I suppose it's possible it could just be a JRE, but I haven't tried that). Then, install the JDK of whatever version you need, and specify that in the "Installed JREs" list. Make sure that the page underneath that, "Execution Environments" maps the "JavaSE-1.8" to your installed JDK.
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.
So I'm trying to install Eclipse IDE for Java on my main pc.
I had no problem installing it on my laptop but when trying to install it on my PC I get JRE Missing webpage.
I've installed the JDK and JRE and they are both working. I could use some advice.
i also had the problem with eclipse and the JRE.
Try to delete the 2 Java versions and deinstall eclipse.
then install the JDK first and seccond the JRE. after the 2 installations install the new eclipse version(in the installer you chan choose between some installations take the first).
i hope I can help you.
Unless explicitly told in eclipse.ini Eclipse uses the system wide java command.
Easiest for you right now is to install a system wide JRE (same 32/64 bit flavor as eclipse).
I had the same issue. It was happening when installing different match of JDK version (11 in my case), with JRE (8 in my case).
So, in order to have this installation of Eclipse working make sure that you have both JDK and JRE referring to the same version. Installation will not work if they have different versions.
My qustion is really simple, all in the title.
After some tests I found that by given a JRE/bin directory in the path(environment variable) , Eclipse can run normally with no problem. And Eclipse will never try to find the JRE by using JAVA_HOME variable.
And in eclipse, I know that I can add installed JREs in the window preference and choose a JDK folder instead of a JRE folder. And for each project, we can change the compiler level.
Since Eclipse can also compile the codes, when is JDK used? Debug? or what?
Eclipse uses its own compiler to compile Java code. It is different than the javac compiler that comes with a JDK. In fact, you don't need a JDK to compile and run normal Java projects in Eclipse. A JRE is obviously needed to reference the required Java libraries.
However if you are using Maven or some other tools that sometimes depend on a JDK component, then you need to install a JDK on your machine. For example, Maven has an option to rely on the tools.jar that comes shipped with a JDK.
Eclipse uses the JRE you specified as default or per project settings. This could be a (only) JRE installation or a JRE from a JDK installation.
I think the more interesting question is: When should I use a JDK instead of an JRE?
The JDK includes tool that are not included in the standalone JRE. E.g. the javadoc.exe for exporting the documentation from javadoc annotated comments in the code. This Program is not included in a standalone JRE. so if you want to export your javadoc documentation you need to add an installed JRE based on a JDK installation first, so Eclipse is able to use the javadoc tool.
It could be a little hard to give a thorough answer to this but I know that at least for using Maven/m2e Eclipse needs to be run in a JDK.
First of all eclipse is a java code it wouldn't run without java installed to prove it (on your personal expence) copy the eclipse folder elsewhere and uninstal the JDK and try to run jave it wouldn't it would output the error message no JDK but instal JDK and run eclipse from the copied location it would run as a first time asking you about the workplace directory!.
I am using windows 7 64, IDE netbeans 8. I have got some projects compiled in different jdk versions jdk 6, jdk 7 and jdk 8, manytimes I face the error of major.minor, to avoid it I am changing the jdk according to need, but it consumes a lot of time to install and uninstall jdks again and again. Is there any easy way to add and use all the jdks in the netbeans by switching etc.?
If you have a project open, you can go to file -> project properties. At the bottom of the window you'll find a menu labeled source/binary format. You should be able to select the jdk version there.
I am not sure if you are using ant/maven/gradle to build your project with, but you can specify the source and target compatibility for each specific project.
maven -> http://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html
ant -> http://ant.apache.org/manual/index.html
gradle -> http://www.gradle.org/docs/current/userguide/java_plugin.html#N1223E
See FaqJdkHome and How to set and use different JDK versions in NetBeans.