Have Java 8 for Luna and Java 7 for Juno - java

I want to use both Eclipse Juno and Eclipse Luna simultaneously in my machine, for different projects.
My machine has Java 8 installed. This works perfect with Luna since the projects I have in Luna are exclusive to Java 8.
My projects in Juno need Java 7 strictly. It seems I have a build path issue (I guess it is because I don't have Java 7 in my system).
I downloaded JRE 7 and tried to install it. However, it tells me that I already have Java 8 installed in my machine.
What do I do then? How can I have Java 7 for my Juno projects?
Mac OSX Mavericks.

You can specify in the eclipse.ini file which JVM you want to use.
The JVM does not even need to be installed, it is enough to unzip it to some folder.
Simply create an entry like this:
-vm
C:\Java\JDK\1.6\bin\javaw.exe
See also:
https://wiki.eclipse.org/Eclipse.ini
In Eclipse you can add the JVMs without having them installed as well:
Windows / Preferences / Java > Installed JREs

If you would be doing development with Java 7, you need the JDK as opposed to the JRE.
In Eclipse, you make your project FACETED, then right click on your Java 7 project and go Properties. From there, you can select Project Facets and then you can modify the Java version you would be using for that particular project.
I have multiple Java versions (JDKs) installed and this is how i control the version i am using in my projects.
Hope this helps!

Related

Apache NetBeans IDE 12.0 cannot create new java application

I installed Java NetBeans IDE 12.0 and JDk-16. When I try to create a project using Java With Ant, it get stuck like in the screenshot. When I cancel it, it creates the file but no code in it i.e., no main method is created. Just a blank file.
Does anyone know how to solve this?
From the NetBeans documentation for "Deployment Platforms" for NetBeans 12.0:
Apache NetBeans 12.0 runs on the JDK LTS releases 8 and 11, as well as
on JDK 14, i.e., the current JDK release at the time of this NetBeans
release.
NetBeans may work (or appear to work) with newer JDK releases that are not officially supported such as JDK 16, but you run the risk of hitting unexpected problems.
So if you don't need any Java features released after JDK 14, download and install JDK 14, and add it as a Java platform in NetBeans, using Tools > Java Platforms > Add Platform.... You don't need to uninstall JDK 16.
However, if you really need JDK 16 features then use a different IDE. The latest release of Eclipse, 2021-03, explicitly supports JDK 16.
I had the same problem and was able to solve it in windows by following the steps below:
Uninstall Netbeans 12.4. Make sure to delete all the cache files
(Drive:\users\user\AppData\Roaming\Netbeans and
Drive:\users\user\AppData\Local\Netbeans) (Windows)
Check your JDK 16 directory (no JRE) and environment variables JAVA_HOME, CLASSPATH and PATH.
Install Netbeans 12.4
Create new project and check that you select Download and activate nb-javac.
For me it helped using NetBeans version 12.5 and the JDK 14. After that everything was running smooth.
I had the same problem and upgrading to version 12.5 worked for me.

NetBeans Installation

Is it true that just JDK version 7 could be used to install NetBeans IDE 8.0.2?
On my device, I have been installed the last version of JDK, but while I am installing Netbeans, a message appeared to tell that I have to install JDK. In other words, Netbeans didn't recognize that there is already a JDK and successfully installed !!
NetBeans 8.0 runs just fine with Java 8.
If NetBeans doesn't detect or find your JDK, you can always provide the location on the command line when starting NetBeans, e.g.:
netbeans64.exe --jdkhome c:\Java8
I have never used the NetBeans installer, but I think you can pass that parameter to the installer as well.
Once, installed, you can also edit conf/netbeans.conf and un-comment the line #netbeans_jdkhome="/path/to/jdk" and make it point to your JDK:
netbeans_jdkhome="c:\Java8"
The Java SE Development Kit (JDK) 7 Update 10 (or later) or JDK 8 is required to install NetBeans IDE.
As seen on NetBeans 8.0.2 Installation Instructions it seems you really have to be on JDK 7 or 8.
While installing one of those versions, remind yourself to set the PATH variable.

Glassfish on Eclipse on Mac

I am using Eclipse Luna on Mac Maverick.
I have downloaded GlassFish and extract it.
I have downloaded the Glassfish toolkit from the marketplace.
I am using Eclipse EE.
JAVA_HOME is set to /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin
When I try to define a new server, why isn't glassfish showing up as an option? What have I missed?
The problem is actually Eclipse. JDK 7 only works with Eclipse EE in 64 bits version. So, basically if want to make glassfish an available server: you need to:
Use Eclipse EE 64 bits version
Use JDK-7
Make sure your JAVA_HOME is set/updated
(In Mac, it usually sits under /Library/Java/JavaVirtualMachines/)
In Eclipse marketplace, download and install Glassfish-toolkit
(and restart the IDE of course)
Make sure your Eclipse EE/Project is using the correct JDK
(Preference -> Java -> Installed JREs)

Netbeans 6.9.1 not working on windows 8

I want to make Java Desktop Application but Netbeans 6.9.1 is not working on windows 8.1 (it crashes on double click to run). I have installed JDK8 along with Jre7 (both 32 and 64 bit). How to make it run, Netbeans 8 is working properly.
Netbeans 6.9.1 is not working on windows 8.1
You must have JDK 6.0 on your system to install and run NetBeans IDE 6.9.1.
Source NetBeans IDE 6.9.1 Release Notes.
To make Netbeans run on JDK 6, if you have more than one JDK do this:
You can change the JDK for Netbeans by modifying the config file:
Open netbeans.conf file available under etc folder inside the NetBeans
installation. Modify the netbeans_jdkhome variable to point to new JDK
path, and then Restart your Netbeans.
Sample
# Default location of JDK, can be overridden by using --jdkhome <dir>:
#netbeans_jdkhome="C:\Program Files\Java\jdk1.8.0_45"
netbeans_jdkhome="C:\Program Files\Java\jdk1.6.0_45"
mainly the problem is that your netbeans and jdk are not compatible. you should download lastest jdk 8 and netbeans which you can from here.
DONT FORGET TO SET PATH.
I got a Solution
You must have JDK 6.0 on your system.
Then SET PATH at time of installation to JDK 6.0 .

Change the Java version Eclipse is running under

I want to run my Eclipse in a newer Java version (jdk 1.7) because of compatibility problems with the Window Builder Plugin
"Eclipse is running under 1.6, but this Java project has a 1.7 Java compliance level, so will not be able to load classes from this project. Use a lower level of Java for the project, or run Eclipse using a newer Java version."
So I suppose, I've to change the vm of Eclipse in the configurations.
-vm
C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll
eclipse.home.location=file:/C:/Program Files (x86)/Eclipse IDE for Java EE Developers/
eclipse.launcher=C:\Program Files (x86)\Eclipse IDE for Java EE Developers\eclipse.exe
eclipse.launcher.name=Eclipse
eclipse.p2.data.area=#config.dir/../p2/
eclipse.p2.profile=epp.package.jee
eclipse.product=org.eclipse.epp.package.jee.product
eclipse.startTime=1351770082498
eclipse.vm=C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll
eclipse.vmargs=-Dosgi.requiredJavaVersion=1.5
But I'm not realy familiar with all the statements, and my question is which ones do I've to change in order to run Eclipse with jdk 1.7?
Edit the eclipse.ini file to point -vm to JDK 7

Categories

Resources