Installing Groovy 1.8 on Spring Tool Suite 3.6.1 - java

I have Spring Tool Suite 3.6.1, which is based on Eclipse 4.4.
I installed the version of Grails I need, but I noticed that the Groovy compiler is at 2.3, whereas I need it to be at 1.8.
I've gone to dist.springsource.org on the Eclipse Marketplace to look for the Compiler 1.8. I can install it, but it automatically uninstalls the existing Grails IDE. On top of that, it doesn't appear under Preferences - Groovy - Compiler and I don't seem to be able to select it.
What am I doing wrong? Do I need to use an earlier version of the Spring Tool Suite to access this particular compiler?

I'd recommend using the snapshot update site to get the latest groovy-eclipse: http://dist.springsource.org/snapshot/GRECLIPSE/e4.4/
That includes the 1.8 compiler and the latest groovy-eclipse 2.9.1 builds that work with it - the 2.9.0 release had trouble with groovy 1.8. (But 1.8 is getting quite old now so we may drop support in the not too distant future).
That snapshot build should also be compatible with grails-ide, not sure why it would be uninstalling grails-ide (but remember that grails-ide is different to the grails-runtime - have you definitely installed both from the dashboard extensions page or just the runtime?)

Related

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".

Do I downgrade my JDK or upgrade my gradle?

I am currently using Gradle 3.0, which supports JDK 9. I tried to download JDK 9 from Oracle's official website but you need an account for the archived versions (they require a company name and a work phone, none of which I can provide). My version of JDK is 15.0.1. As far as I know, the latest version of Gradle supports it. However, I'm not sure how to update Gradle in my workspace. Would updating it cause any errors since it's a huge gap between the versions?
For reference, the older version of Gradle came with the mod developer kit of the forge. I am currently working on the 1.8.9 version of Minecraft. I am using IntelliJ, not Eclipse. I apologize if I didn't structure my question properly.
IntelliJ IDEA has JDK downloader that offers multiple JDK versions/vendors. You can use JDK 1.8 for Gradle 3.0 or JDK 11 for Gradle 5.0+:
Just Install sdkman.io
Then upgrading the Gradle/maven/jdk and many other JVM project is as easy as running a command.
You can also switch between versions in a very convenient way.

Is there a way to get a map of maven plugin version and their required java version?

I'm maintaining a parent pom for my team which will provide the latest compatible version of various maven plugins per the JDK that the project uses. Sometimes if a project utilizes an older version of Java (like 1.5) maven will fail due to a plugin requiring a newer version. Is there a way to get a map of a given plugin and see what the minimum java version is for said plugin? I was thinking there was some sort of report or something that would show me that, but I'm not seeing anything.
What about: https://builds.apache.org/view/M-R/view/Maven/job/dist-tool-plugin/site/dist-tool-prerequisites.html Apart from that on every plugin page you can find the goals page which contains the information you need. One more thing if you are using not the most uptodate versions all older versions pages are available where you can look at which version which JDK versions uses. It shouldn't be problem to write some kind of script to programmatically extract the information of the older plugins. The above site contains the informations of the uptodate plugins.
Apart from that plugin version selection basead on JDK version is not a good idea. The plugins have only a minimum version for JDK they need to run with. Apart from that they run on all versions (already on JDK 9 with one exception)...Furthermore plugins might require a minimum Maven version to run with which is either Maven 2.2.1 or Maven 3.0+ which shouldn't a problem.
You should define your plugins versions simply based on problems you might have but i would recommend to keep uptodate with your plugins.
If you need running you build with JDK 6 for example, but you use Maven 3.3.X which needs JDK 7 to run you can achieve this by using toolchain to handle this situation.
In theory this shouldn't be an issue. Maven will use the Java version you run it with, so the plugin's dependency will be satisfied, independent of the project's language level. Just make sure your devs are using a current version.
Example: running Maven with Java 8 will satisfy the dependency of a Plugin that requires Java 8, independent of the project's source and target level.
(With dependencies it's more complicated, I am afraid, but since you are not actually coding against your plugins, you should be fine)

How to add jdk8 in Eclipse Indigo

I just read How to have Eclipse use JDK8 to compile a project?
What i added jdk8 to eclipse as,
From the answers of How to have Eclipse use JDK8 to compile a project?
I tried to Update the JDT/Core, JDT/UI bundles from http://dist.springsource.com/snapshot/TOOLS/java8/e43
But it shows error as,
"Eclipse Java Development Tools Patch for Java 8 Support (BETA)" is not applicable to the current configuration and will not be installed.
"Eclipse Plug-in Development Environment Patch for Java 8 Support (BETA)" is not applicable to the current configuration and will not be installed.
How Can i fix it ?
I can say that Java 1.8 does in fact work with Eclipse Luna ( the beta version released around March 17, 2014) or later. I tried it and it was good.
Also, I noticed that in the Eclipse Marketplace, there are now plugins to install functionality into Kepler to support JDK1.8. I haven't tried the plugin myself though.
This is a old topic but I just wanted to point out that I have searched enough to find that Indigo version can't be updated to S.E 1.8 here the link which is given on eclipse website to update the Execution Environment but if you try it will throw error for Indigo.
Here is the link where the Information about execution environment is given.
This shows the step by step to update Execution environment.
I have tried to update Execution environment and I got the same error.

GAE getting started in Java, Eclipse Indigo - can't compile as 1.6

I feel like I keep going in circles with this one. I followed the Getting Started guide for Google App Engine (https://developers.google.com/appengine/docs/java/gettingstarted/) in Eclipse and everything went relatively well until I uploaded it to the App Engine.
I was getting 500 errors so I checked the logs and found this: "guestbook/SignGuestbookServlet : Unsupported major.minor version 51.0]"
I then search for this problem (on stackoverflow, of course) and found this solution: Google App Engine and Java Version?
So I set the compliance level to 1.6 and then at the bottom of the dialog I get the warning that "When selecting 1.6 compliance, make sure to have a compatible JRE installed and activated (currently 1.7)".
I happy click OK, and it prompts for a rebuild. After the rebuild I then get this new error: "Java compiler level does not match the version of the installed Java project facet."
Not having knowingly used any facets in the project I do a search for some help (again on stackoverflow) and find this: "Faceted Project Prblem (Java Version Mismatch)" error message
Unfortunately it is not even close to being helpful because I am not used Maven, and when I bring up the properties of the project there is no Project Properties -> Project Facets panel for me to change a version on.
So it seems that I am stuck with something that either cannot be compiled in Eclipse or cannot be deployed to App Engine. I know that I am probably missing something obvious here but I can't quite put my finger on it.
UPDATE: I have uninstalled all JREs and JDKs, and reinstalled only jdk1.6.0_32. The problem continues exactly the same.
I had the same problem. I was able to resolve by using the Navigator view and editing the .settings/org.eclipse.wst.common.project.facet.core.xml, changing to:
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="java" version="1.6"/>
</faceted-project>
After this change, the error went away and I could successfully run the GWT project in DevMode using jre1.7 but java 1.6 compliance level.
It really seems there should be a way to edit this java facet via project configuration, but I couldn't find it in Juno.
The answer, at least in my case, seems to be that if your Eclipse default compiler level is set to 1.7 when you create the Web Application then you can't switch it down to 1.6 successfully.
Example 1: Using JRE 1.6
In eclipse set Preferences->Java->Installed JREs to jdk 1.6.0_32
Set Preferences->Java->Compiler to compliance level 1.6
Use google plugin to create "New Web Application"
Run it locally - success
Deploy to app engine, run remotely - success
Example 2: Using JRE 1.7
In eclipse set Preferences->Java->Installed JREs to jdk 1.7.0_04
Set Preferences->Java->Compiler to compliance level 1.7
Use google plugin to create "New Web Application"
Run it locally - success
Upload to app engine - failure (Unsupported major.minor version 51.0)
In eclipse set Preferences->Java->Compiler to compliance level 1.6 - failure (won't compile locally (Java compiler level does not match the version of the installed Java project facet).
Solution:
Before using the google plugin to create the Web Application, switch the JRE and compiler level to 1.6 (as seen in example 1).
If your project already exists, then hopefully you haven't got too far with it and can create it again.
After fighting this issue for a few hours, deleting my nocache.js in the war folder was the final piece of the puzzle.
Contrary to the answer above, I was able to succesfully downgrade to compliance level 1.6 after creating the application in 1.7

Categories