How do I get gradle 7 to work in IntelliJ IDEA? - gradle

I am having some troubles with setting up a project with gradle 7.1. I can't go below 7 because Fabric Loom 0.8+ needs gradle 7+.
The Intellij IDEA log: https://controlc.com/1c0be753
Using Gradle 7.1 and Java 16

See the related comment in IntelliJ IDEA bug tracker and this bug request on Gradle GitHub. The exception could be caused by the filesystem (FAT) and is fixed in Gradle 7.2

Related

Intellij Idea: Gradle sync cancelled even if it successful from command line

I am opening a working Gradle project in Idea, but it is failing to sync. In the sync window it says Sync cancelled. I tried changing proxy settings, project SDK, reboot, killing gradle daemon forcefully, but no luck
Solved the problem by changing Gradle JVM from settings.
In Maven project we can set project SDK, and it will be used for Maven build also.
But for Gradle we have to set it differently. Setting project SDK alone doesn't help as it is used only for project by Idea and not for Gradle.
Need to set the Gradle JVM to compatible JVM
Go to Settings
Search for Gradle under Build Tools
Set Gradle JVM to >=1.8

How to add a JRE 1.8 into Eclipse Installer JRE?

I am trying deploy my Spring Boot application to Elastic Beanstalk.
The problem that I am facing right now is, my application is developed with Tomcat 9, Java 13 and Project Facet 4.0.
So when I deployed to a AWS environment, I kept getting error. After researching, I found out AWS only support Tomcat 8, Java 8 and Project Facet 3.0.
I managed to change Project Facet 4.0 to 3.0.
But I can't add Java 8 to the project.
I downloaded the JDK 8 from Oracle, and tried open jdk-8u251-macosx-x64.dmg and run JDK 8 Update 251.pkg.
The system keeps giving me error that: "JDK 8 Update 251.pkg" can't be opened because Apple cannot check it for malicious software. This software needs to be updated.
Anyone know how to fix this problem so that I can run JRE 8 on eclipse?
Here is picture the problem that I have when I deploy the app to AWS.
An internal error occurred during: Updating AWS Elastic Beanstalk environment
Here is the thread that I tried to follow but without success:
https://github.com/aws/aws-toolkit-eclipse/issues/149.
Can you elaborate where exactly are you seeing the error? While running the JDK package or while configuration the JDK within Eclipse?
Nevertheless, I suppose your main requirement is to get your Eclipse to use Java 8.
It can be done in multiple ways.
Usually you can change Java compiler level to 1.8 from Project Settings even if you're using Java 13.
If you're using Maven, you can specify compiler source and target to Java 1.8
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
Alternatively, you can download the JDK 8 zip instead of installer, unzip to any location and use that in Window > Preferences > Java > Installed JREs. Be sure to mark that one as default JRE.

Wrong Major Version number when running Sonar Scanner with Java 11

I'm currently migrating a project from java 8 to java 11, and have been using Sonar scanner, with gradle, to send the code to SonaQube. After migrating to Open JDK 11, I amd getting the following error when running the gradle sonarqube tasks:
java.lang.IllegalArgumentException: Unsupported class file major version 55
I have read online that the scanner should be run with jdk 8, even though the analysis can be run on an version of java files, but have not been able to figure this out.
Ideally, I would be able to run gradle sonarqube with the Java 11 JDK. I found another question seeming to have success with Java 11 using Maven, but their error is different, and I don't think their solution would apply to me.
Is this problem solvable, or will I need to wait for Sonar Scanner to have support for JDK 11?
If someone like me this will helpful.
Source code Java 8(55), with jenkins and sonarqube scanner.
My error was
INFO: SonarScanner 4.6.2.2472
INFO: Java 11.0.11 AdoptOpenJDK (64-bit)
.....
java.lang.IllegalArgumentException: Unsupported class file major version 55
Check this link : Why does sonar-scanner force the usage of the embedded JRE?
And Change your sonnar-scanner.bat or sonnar-scanner.sh
use_embedded_jre=false

Unable to register extension org.sonar.plugins.cobertura.CoberturaSensor from plugin 'cobertura'

Since I updated my sonarqube server to 6.1 I'm getting this error in my gradle project.
I'm using sonar plugin latest version (2.2)
classpath("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.2")
anyone knows how to solve it?
Thanks!
I resolved this problem by delete the cobertura jar file in the plugins folder. It seems sonarqube 6.1 does not support cobertura any more. because after i delete the file i can't find cobertura in the sonar plugin management page.

Can sonar build java 6 and java 7 projects on a single server?

We have a server that runs Sonar and previously only had Java 6 installed and everything worked fine. We now have a Java 7 project and are encountering the "Unsupported major.minor version 51.0" version when the Maven surefire plugin tries to analyze the project.
Is there a way to specify the Java version sonar should use for a specific project?
Java 7 is already installed on the server.
Thanks in advance!
Never mind found the JDK option under Advanced in the Jenkins configuration for the job.

Resources