Jhipster project - error with ConfigurationMetadataAnnotationProcessor class in spring-boot app - spring-boot

I just start a new Jhipster project on my computer.
I have install the Open JDK 11.0.6, the last version on node and npm (node 16.15.0).
I have created the project with jhipster to test it but I have some issues to launch the backend part with spring-boot in Intellij.
When I open my project in IntelliJ and launch the Spring boot app, I got this error:
java: Supported source version 'RELEASE_6' from annotation processor 'org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor' less than -source '11'
This error comes during the compilation of the application
I put below some screen of my configuration
My java version in cmd
My java in PATH variable
Java set in project INTELLIJ as SDK
Java for the module
And to finish, before all this, a java 1.6 was install on the computer but I have cut all the way to call it (PATH & JAVA_HOME). I can't delete it totally because I'm not an administrator of my computer.
Thanks for the idea in advance,
Have a good day,

Related

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.

Error occurred during initialization of boot layer java.lang.module.FindException: Module jdk.management.agent not found

I am setting up my first Spring Boot application using Eclipse > New > Spring-Starter project
The project files are appearing and compiling.
I am even able to RunAs > Java project with console output.
On choosing RunAs > Spring Boot, I am getting the above error in the console:
Error occurred during initialization of boot layer java.lang.module.FindException: Module jdk.management.agent not found
My Java version is Java15, and I have also verified the same path is being used by Eclipse in About Eclispse > Installation Details > Configuration which shows
-vm C:\Program Files\Java\jdk-15.0.1\bin\server\jvm.dll
Running java --list-modules shows the management.agent module in the list shown in the command line output:
jdk.localedata#15.0.1
jdk.management#15.0.1
jdk.management.agent#15.0.1
jdk.management.jfr#15.0.1
Maven version installed is 3.3.6
I am not sure what I am missing. Any ideas?

gradle-wrapper.properties not found after clean install intellij idea 2020.1.2 community edition on windows 10

Installed clean windows10(1607) and intellij idea(2020.1.2 community edition). When i create new gradle project
Invalid Gradle JDK configuration found. Open Gradle Settings
"gradle-wrapper.properties not found".
How can I fix it?
Install gradle 6.7
sdk install gradle 6.7
brew install gradle
Go to IntelliJ and set gradle version:
On File >> Settings >> Build, Execution , Deployment >> Gradle
or
Preferences >> Gradle
In Use Gradke from specific the correct location
If IDEA is set to use the Gradle wrapper (as it is in your screenshot: "Use Gradle from:" is set to "gradle-wrapper.properties"), IDEA expects the following file structure:
Gradle wrapper JAR: [project root]/gradle/wrapper/gradle-wrapper.jar
Gradle wrapper properties: [project root]/gradle/wrapper/gradle-wrapper.properties
Gradle wrapper script: [project root]/gradlew.bat
If you are missing one of these three elements, IDEA will attempt to generate the wrapper by calling the gradle wrapper task. It will do this using the Gradle JDK, which may or may not be the project SDK (File > Settings > Build, Execution, Deployment > Build Tools > Gradle > Gradle JVM).
I'm not sure how it selects the version of Gradle it uses - I only have 6.8.3 installed on my machine, and I had my wrapper properties set to 7.0-rc-1, yet somehow it used 6.7.0 when generating the wrapper.
I tried various options for clearing the cache, but did not get the result.
Openjdk-14 installed by default and does not work. From site adoptopenjdk.net install OpenJDK 11 (LTS). When creating the project, I chose 11 version. Then the program suggested updating gradle to version 6 and it worked.
I ran into this problem a while ago when I upgraded to intellij 2020.* The first time I created a new project there was no problem: gradle daemon did its work and the project was created with no problems.
In my case, the project would start a new gradle daemon, and attempt to build the project, would get rejected by windows Security, and nothing would happen, so intellij goes ahead and starts another (unsuccessful) daemon. Soon, I had 20+ gradle daemon processes running on my system, all of them doing nothing.
So, it looks like intellij has messed in enabling that it places the appropriate permissions it requires for these folders that it depends on to run properly. So, you need to manually give these permissions, and then things (should) work.
The real issue here is security on your machine: either a virus checker or the security software, Windows Security on Windows 10, for example. The first time you make a project, Intellij goes and produces a number of folders that they need access to.
However, once these folders are available, for whatever, intellij doesn't make sure to give itself access.
On windows 10, in AppData, you'll find several folders required by Intellij to produce, in my case, produce gradle projects.
Try finding the various folders that Intellij has produced on your system, and give them exceptions on your virus checker and on whatever firewall/security software programs that may block access.

Intellij issue resolving dependency for spring kotlin

Intellij is giving me errors all around for brand new kotlin/spring project and I cannot build or run the project from the IDE.
If I do it from the command line however, there are no issues and I can build and run the app.
'classpath' in 'org.gradle.api.artifacts.dsl.DependencyHandler' cannot be applied to '(groovy.lang.GString)'
'apply' in 'org.gradle.api.plugins.PluginAware' cannot be applied to '(['plugin':java.lang.String])'
Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencie
Type mismatch.
Required:
java.lang.String
Found:
kotlin.String
Any ideas to what may be the issue?
I tried Kotlin multiplatform JVM type mismatch in InteliJ but doesn't seem to fix the issue.
UPDATE:
Cleared gradle caches, reinstalled Intellij, Import project that was created from start.spring.io with Gradle and Kotlin selected.
Using default gradle wrapper and project jdk (the path says jre)? gives me an error. Open gradle settings just opens the file explorer.
Using default gradle wrapper and machine local JDK same issues with the dependencies from above.
This issue comes up if you set up your own module inside IntelliJ and you think that since you are doing a Kotlin (Maven) project, the SDK should be set to Kotlin. Wrong!
The problem is shown in the first image. The project SDK is set to Kotlin.
Change it to Java. Probably any 8+ Java will be good enough.
This solves the IDE errors and the compiler errors as well.
Unset KOTLIN_HOME and other Kotlin- or Java-related settings you may have in your environment (env to check, unset NAME to unset.)
Then kill any Gradle daemon still running (pkill -f GradleDaemon) and test your Gradle build from the terminal. If all goes well, remove the .idea directory; restart IDEA, making sure to run it without the stray environment variables (for example, launch idea.sh from the terminal where you unset them); and re-import your project, with the choice of using the default Gradle wrapper.
If you need to use standalone Kotlin versions, installed for example through SDKMAN, consider taking the SDKMAN activation lines out of your shell init file (.bashrc for Bash) and into a standalone script (say, ~/bin/sdkman) that will also change your shell prompt (PS1 in Bash) to remind you that you have entered a SDKMAN-managed CLI session.

SocketTimeoutException while opening New Spring Starter Project wizard on STS running with Java 7

I'm using the ZIP distribution of STS 3.5.1 for win32.
I start STS with this cmd script:
set JAVA_HOME=d:\jdk\jdk1.7.0_21
set PATH=%JAVA_HOME%\bin;%PATH%;
start .\sts-3.5.1.RELEASE\sts.exe
Then, when I do "New > Spring Starter Project", I get this error:
If I replace Java 7 with Java 6 by changing the first line of my cmd script, everything works fine: the wizard starts.
set JAVA_HOME=d:\jdk\jdk1.6.0_31
Is there something special to do if I want to use Java 7 ?
You probably want to get a more recent version of the JDK 1.7 (e.g. 1.7.0_51) as there were quite a few unpleasant bugs in earlier releases. Otherwise I don't have any suggestions. Can you see the service (http://start.spring.io) from your browser?

Resources