idea.log is helpful when a problem is inside Studio.
But you said that you are trying to execute JAR, so perhaps you are doing it in the terminal.
Copy the whole console output from the moment you launched the command.
The following line tells that Java 23 can cause problems: 2025-01-02T08:56:58.558+08:00 WARN 8248 --- [ main] eclipselink.logging.all : Java SE '23' is not fully supported yet
When I run this command, it return error ./gradlew “-Pvaadin.productionMode=true” bootJar
Starting a Gradle Daemon (subsequent builds will be faster)
Task :compileJava
Enhancing entities in root project ‘projectmanagement’ for source set ‘main’
Project entities:
JPA: [com.company.projectmanagement.entity.User, com.company.projectmanagement.entity.Project, com.company.projectmanagement.entity.Task, com.company.projectmanagement.entity.TimeEntry];
DTO: ;
Project converters: .
Running EclipseLink enhancer in root project ‘projectmanagement’ for source set ‘main’
[EL Warning]: 2025-01-03 16:13:55.671–Java SE ‘23’ is not fully supported yet. Report this error to the EclipseLink open source project. (There is no English translation for this message.)
[EL Warning]: weaver: 2025-01-03 16:13:55.804–Weaver encountered an exception while trying to weave class com/company/projectmanagement/entity/Project. The exception was: Unsupported class file major version 67
[EL Warning]: weaver: 2025-01-03 16:13:55.807–Weaver encountered an exception while trying to weave class com/company/projectmanagement/entity/Task. The exception was: Unsupported class file major version 67
[EL Warning]: weaver: 2025-01-03 16:13:55.811–Weaver encountered an exception while trying to weave class com/company/projectmanagement/entity/TimeEntry. The exception was: Unsupported class file major version 67
[EL Warning]: weaver: 2025-01-03 16:13:55.818–Weaver encountered an exception while trying to weave class com/company/projectmanagement/entity/User. The exception was: Unsupported class file major version 67
Running Jmix enhancer in root project ‘projectmanagement’ for source set ‘main’
Thanks, your code is correct.
The culprit is obviously Java 23 which you are using to build the app:
[EL Warning]: weaver: 2025-01-03 16:13:55.804–Weaver encountered an exception while trying to weave class com/company/projectmanagement/entity/Project. The exception was: Unsupported class file major version 67
The screenshot you provided shows that you are using the correct Java 21 in the IDE. But when you invoke commands in the terminal, you are working with Java 23.
after I remove the Java 23, it works now but I get below error when I run this command
C:\Users\seikfei.jdks\liberica-full-21.0.5\bin\java -jar projectmanagement-0.0.1.jar
Exception in thread “main” java.lang.UnsupportedClassVersionError: com/company/projectmanagement/ProjectmanagementApplication has been compiled by a more recent version of the Java Runtime (class file version 67.0), this version of the Java Runtime only recognizes class file versions up to 65.0
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:524)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:427)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:421)
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:420)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593)
at org.springframework.boot.loader.net.protocol.jar.JarUrlClassLoader.loadClass(JarUrlClassLoader.java:107)
at org.springframework.boot.loader.launch.LaunchedClassLoader.loadClass(LaunchedClassLoader.java:91)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:534)
at java.base/java.lang.Class.forName(Class.java:513)
at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:99)
at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:64)
at org.springframework.boot.loader.launch.JarLauncher.main(JarLauncher.java:40)