How to run old version of gradle? - java

So I am trying to learn how to code minecraft mods for 1.8.9. This is an old version and I was told to use Java 8 to code it. I tried to run Java 8 with Eclipse but from what I am seeing, it only uses version 11+.
Is there a way to maybe download an old version of eclipse that will run 1.8.9 gradle?

The current Eclipse can run code using any version of Java. Eclipse itself needs at least Java 11 to run, many Eclipse downloads include a suitable Java.
Once you have installed Eclipse you can tell it about other versions of Java which can be used to run programs. Open the Preferences and on the "Java > Installed JREs" page add the JRE/JDK you want to use. You can specify as many versions as you like here.
You can then choose the Java to use in the project Properties and in the Run Configuration.

Related

Ubuntu: Unable to start eclipse

I removed java-11 and installed jdk-1.8. Now when I try to start eclipse then its throwing the following error:
Being a beginner I searched and found some solutions but not worked for me
Ok. I'm going to make some assumptions based on some implications of what you've said here.
I assume that you had Java 11 installed, and you had installed Eclipse, and it was working.
You then, for some reason that I can't understand, decided to uninstall Java 11 and replace it with Java 8.
The error message is because when you had Java 11 installed and you installed Eclipse, Eclipse stored the path to the Java 11 distribution in the "eclipse.ini" file. Now that Java 11 is gone, it cannot start up.
The easiest way to fix this is to reinstall Java 11, and hopefully it will install into the same location as that error message shows it is looking for it.
Now, to address why you might have thought to replace Java 11 with Java 8. I'm guessing you're working on an application that requires Java 8 to compile and run. In this context, it's somewhat understandable that you would have done what you did, but it was the wrong thing to do.
Eclipse can run with one Java version, but build and run applications with a different Java version. In fact, I think it's generally a good idea to run Eclipse with the newest version of Java it can run (generally about a version short of the latest), but build your applications with the version of Java required for those applications.
So, you should have both Java 11 (or newer) AND Java 8 installed. Run Eclipse with Java 11, and build and run your applications with Java 8. In Eclipse, you have to register the Java 8 distribution in "Installed JREs" in Eclipse preferences, and also record that Java distribution in the "JavaSE-1.8" Execution Environment, in the preferences tab right below "Installed JREs". Set your application to require "JavaSE-1.8".

How to Use Java 8 settings to build project in eclipse 4.18(2020-12)

*Due to some project requirements I "have" to use eclipse 4.18 (2020-12) which uses Java 11 by default and is mandatory to start.
But my entire project is/was written in Java 1.7 earlier. Now , in my mac i have both java 1.8 and 11 installed also my eclipse settings are such shown below.
I have made sure removed all java 11 references in my eclipse and made the project and workspace configure to take the 1.8 jdk and run at 1.7 compiler level.*
but when i run ,project -->clean-->build, i run into the JaxB missing in java 11 ( in java 11 JAXB was removed and my project uses jaxB extensively) This is known.
So i am wondering what am i missing that my projects are still building my project with java 11 and not java 1.7 (using jdk 1.8 configured).
Please help.. stuck on this since some days.
machome
Eclipse Compiler setting-1
Eclipse Setting Execution Envs
Eclipse installed JRE's
Eclipse Project specific setting
Java 11 JaxB error
If Eclipse itself is being run with Java 11, and you have a plug-in installed that has not been properly update to work under Java 11, as it appears, you will need an updated version of that plug-in. Update to the latest "oracle design studio", and if you still see this problem, contact Oracle support.
The latest Eclipse may require Java 11 to run, but it's simple to set up Eclipse projects that use older Java versions. Don't mess with the Java version it uses to start up, as long as that is a proper Java 11 version.
As one commenter mentions, you'll have to have a particular Java distribution configured in "Installed JREs->Execution Environments", and then you'll have to have the project configured to use that Java version symbol, like "JavaSE-1.7".

java version in not match for eclipse

I had java version 8 previous and my eclipse worked just fine. But now I have java version 7 and I can't open eclipse on my computer. What should I do? please help.
I think there are two options:
Upgrade to Java version 8 (or newer).
If you can't do that, downgrade to a version of eclipse that supports Java 7. eclipse 4.5 (Mars) (or earlier as noted on the linked page), as of eclipse 4.6 (Neon) Java 8 is required.
I feel I should note that newer versions of Java (and eclipse) can still target Java 7 (and many earlier versions).
But now I have java version 7 and I can't open eclipse on my computer. What should I do?
Use versions that work together. When you for example look at your second screen shot, it says something like "requiredJavaVersion=1.8" or so.
In other words: you can't just come in and run eclipse with any version of java.
The other answer gives you the required details.
And a final note here: in case you tried to start eclipse with that older JVM in order to "allow" to ensure that eclipse won't allow "java 8" stuff in a project: that isn't the right way then. Instead: eclipse allows you to "define" JDKs to be used for your project. So you can easily tell eclipse: "I have a Java7 jdk sitting here, please use that for project X".
You do not need to run eclipse itself with a Java7 JVM in order to use a Java7 JDK for an eclipse project!
There will be a file under the Eclipse installation directory named as eclipse.ini.
It will launch the eclipse for that specific jdf and you can change the path to your jdk7.
Hope it helps.
It depends basically on which version of the eclipse you have.
If you have eclipse 4.6(Neon) or the latest version, then you must need a newer JDK version of Java (>=1.8 which you need to download). Or If you want to roll back to an older version of Eclipse then consider downloading eclipse 4.5(Mars).
Or If you have an eclipse version of 4.5(Mars) or older then see in eclipse.ini
-Dosgi.requiredJavaVersion = 1.8 and change it to -Dosgi.requiredJavaVersion = 1.7 which can be found in the folder containing eclipse.exe file.

Can't download Java 7 because my computer already has Java 8

I am trying to download Java 7 on my mac. All my professors require java code to be in Java 7. I have the dmg downloaded but when I double click the icon to install I get the error message :
A newer version of Java is already installed.
The only thing I can do is click close and it exits the install. How can I install Java 7 onto my machine?
If you are doing your "development" using an IDE like eclipse, there is a simple solution to your problem: within eclipse, you can change the "compatibility" mode for your projects.
Meaning - even when only Java8 is installed, you can instruct eclipse that your project should be using Java7 only. So when you write source code that uses Java8 features (like lambdas or such things); you will get compiler errors.
The only caveat: you still could be using classes/methods from the Java8 installation that don't exist in Java7.

Use different jre for projects and for eclipse launch

May be its a newbie question...
I want to use latest eclipse available. It requires Java 8. However, our company uses java 6 for all projects.
So:
Should I download eclipse that is compatible with Java 6 only ?
or I can configure Java 6 for all the projects regardless what eclipse uses?
Would there be any issues, if its possible to use two versions (one for eclipse and another one for project)?
I know its a newbie questions. But the search did not yield a proper response.
no, you can use the latest Java for Eclipse. The JDK used for project can be configured per project or per workspace. You can install as much JDKs as you desire. i.e. You can start Eclipse using a 32Bit JDK while using a 64Bit JDK for Java EE-Servers or Projects, it has basically nothing to do with the JRE used for Eclipse. You just need to set it up.

Categories