Getting noclassfoundexception : java.sql.SQLException in intellij idea for jdk 11
Asked Answered
M

1

17

I am using latest version of Intellij Idea and set jdk as 11. When I execute my project it throws exception noclassfoundexception : java.sql.SQLException.

In java compiler settings in Intellij I have mentioned project bytecode version as 11. In project structure settings too, I have set the module jdk as 11.

Magnesite answered 25/10, 2018 at 5:18 Comment(3)
Just to know better, have you included a module-info.java to your project or can you share the project structure and how you are executing?Wabash
I have not included module-info.java. I am just running the Main class.Magnesite
Did Kostiantyn's answer work for you too? If so, it should be accepted, see stackoverflow.com/help/someone-answersPulsometer
E
42

Try to change command line shortening method to "JAR manifest".

JAR manifest setting for unit test

I had exactly the same issue after upgrading my project from Java 8 to Java 11. It looks like it is IntelliJ IDEA bug.

Hint for solution taken from here: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000022399-Error-running-a-cucumber-test-case-Caused-by-java-lang-NoClassDefFoundError-java-sql-Time

Enaenable answered 8/12, 2018 at 12:36 Comment(3)
In IntellIj top right corner where your tests are run, click "Edit Configurations" to get to the screen above.Dissipate
Did not work for me. I am using JPMS and assuming that the error must be related to modules/dependency managementCondemnatory
This won't work for me but when I tried to run the service it's running.Virgo

© 2022 - 2024 — McMap. All rights reserved.