Is SpringSource Tool Suite 2.6 Grails support broken? - spring

I have recently updated my STS from 2.5.2 to 2.6. Since then, each grails project shows an error in the conf/spring/resources.groovy file reading: Description Resource Path Location Type
Internal compiler error: java.lang.VerifyError: (class: org/codehaus/jdt/groovy/internal/compiler/ast/JDTClassNode, method: initialize signature: ()V) Bad access to protected data at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.createClassNode(JDTResolver.java:461) resources.groovy /GrailsProject/grails-app/conf/spring line 0 Java Problem
The resources.groovy file is as good as empty (in default state), and if I delete it, the error is shown on the DataSource.groovy, so the file itself seems not to be the cause.The used groovy compiler version is 1.7.3.I have made a clean STS 2.6 install, installed the groovy and grails plugins and got the same error.What could be the problem? And is there a solution to this not resulting in downgrading to 2.5.2 again? Thank you

Take a look at your preferences Groovy -> Compiler. Are you by any chance accidentally using Groovy 1.6?
EDIT
That didn't solve the problem, but as described in http://forum.springframework.org/showthread.php?p=357361, upgrade to the latest dev build of Groovy-Eclipse as well as Grails Tooling and that should work.

Related

Build-Jdk-Spec version in Manifest.Mf

I am using logback-classic 1.3.5 in my project but it is giving me UnsupportedOperationException. My project is on JDK 8 and when I saw in manifest file of logback-classic-1.3.5, it shows build-jdk-spec version as 19. I just want to know what exactly this "build-jdk-spec" version specifies
The build-jdk-spec attribute is a "default" attribute added by the Maven "maven-archiver-plugin" (reference). The value is the value of the ${java.specification.version} property for the build. It is (I think) the JDK version of the JVM that was running the build tool (Maven).
The [build-jdk-spec] version number most likely doesn't signify anything that is relevant to your problem. (It is NOT the the target Java version for the build!!)
The real cause of your problem can be deduced by looking at the details of the UnsupportedOperationException stacktrace.

how to change gradle version in nativescript

I'm confused as how to change a specific configuration somewhere to determine the version of my gradle, in a nativescript project.
My workspace is created with nx and when I try to run the app with npx nx run test:android I get this error message:
Could not compile settings file '<somepath>\start\learn\apps\nativescript-test\platforms\android\settings.gradle'.
> startup failed:
General error during conversion: Unsupported class file major version 62
Based on my research if I need to resolve this issue I need to either update my gradle version or downgrade my JDK version. The solution I'm searching for is to how to specify my gradle version.
Thanks in advance.
based on my understanding version of gradle is defined by #nativescript/android package (read its README.md), so if updating the #nativescript/android doesn't help do the next steps
1- install jdk 18 -> because its the first version that supports major version 62
2- add JAVA_HOME to env vars
3- in platform/gradle.properties add org.gradle.java.home=C:\\Program Files\\Java\\jdk-18.0.1 (because in my case gradle didn't read form JAVA_HOME)
4- change platform/gradle-wrapper gradle version to 7.4.2
5- in platform/build.gradle do this: replace whatever version of plugin to classpath 'com.android.tools.build:gradle:7.2.0'

Sync error while trying to build project in IntelliJ

Getting the following sync error while trying to build my first helloWorld program in IntelliJ.
I've installed IntelliJ for the first time on my computer running Windows 10.
Could not open init generic class cache for initialization script 'C:\Users\nikhils\AppData\Local\Temp\wrapper_init5.gradle' (C:\Users\nikhils\.gradle\caches\6.6.1\scripts\2xaig2b083uxqwleg0fdntova).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 60
Change project and Gradle JDK to the supported version (8—15). Current Gradle release versions do not support Java 16. You would need Gradle 7 if you want to use Java 16.
The easiest way would be to create a new project with Java 11.
Also note that full Java 16 support will be available starting from IntelliJ IDEA 2021.1 release (current release version is 2020.3.3).
See https://www.jetbrains.com/idea/nextversion/ if you want to give it a try.

Project won't compile in IntelliJ IDEA after adding Maven support because of complaints about the JDK version

I'm using IntellJ 14.1.4 Community Edition
My project compiled fine before (I have it set up to use the Eclipse compiler)
But I tried to Mavenize it...
I added Maven via the Add Framework | Maven command
Now my problem is (still using the Eclipse Compiler)...
It gives me error messages like:
Error:(21, 78) java: '<>' operator is not allowed for source level below 1.7
Which leads me to suspect that it is not compiling to 1.8
However, I didn't change anything other than Mavenizing it
The Project SDK in IDEA is set to use 1.8
I did notice some setting about bytecode being 1.5.. but i tried to change that to 1.8 but still get this error message.
Anyone have any clue what's going on?
this was essentially the correct advice of course - in the comments, however I had been trying to do it for a long time both via maven-compiler-plugin and properties... to no success, even though I was refreshing Maven after making changes to pom.xml. Finally, I restarted the IDE .. and .. it works! I can compile..

Unsupported method: GradleProject.getBuildScript()

I am getting this error while importing an adt project(after exporting and creating gradle file) into Android Studio on mac os x.
The android-studio version is 3.6 (latest) and the gradle version is 1.8 (latest).
The error shows up as:
Unsupported method: GradleProject.getBuildScript(). The version of
Gradle you connect to does not support that method. To resolve the
problem you can change/upgrade the target version of Gradle you
connect to. Alternatively, you can ignore this exception and read
other information from the model.
Consult IDE log for more details (Help | Show Log)
I have no idea where to look for IDE logs...
I was getting a similar error today opening a project after upgrading to Android Studio 0.3.6. Here is what I had to change to get it working again for me.
Changed the following line in gradle-wrapper.properties from gradle-1.6-bin.zip to gradle-1.8-bin.zip
distributionUrl=http://services.gradle.org/distributions/gradle-1.8-bin.zip
Also changed the following line in build.gradle from 0.5.+ to 0.6.+
classpath 'com.android.tools.build:gradle:0.6.+'
In Windows, gradle-wrapper.properties is located at \project folder\gradle\wrapper\gradle-wrapper.properties
build.gradle is located at \project folder\module folder\build.gradle
The Files that Needed changed are highlighted in the project explorer screen shot below.
After those changes I sync'd the project with the gradle files and then could build and test.
Hope that helps.
Note that you should use default or customizable gradle wrapper:

Resources