I am writing a database management program in java in maven in intellij IDEA. For now, the code is only connecting me to the database in MySQL. The code itself has no errors. However, upon running it, the following error comes: java: package com.sun.tools.javac.code is not visible (package com.sun.tools.javac.code is declared in module jdk.compiler, which does not export it to the unnamed module)
I have not explicitly imported the package. I am not an advanced programmer and have no idea how to solve this issue.
According to ChatGPT, the problem may be due to the jdk version I am using i.e Oracle Open jdk version 20. How do I solve this?
com.sun.tools.javac.code
that you are not allowed to use. To fix it you must change your code so that it no longer uses that class. Search for the package name (com.sun.tools.javac.code) in your code to find the places where you use that class.com.sun.tools.javac.code
package, which thejdk.compiler
module does notexports
. This is illegal, and likely means you need to change your code. If you must have access to those types, then look into using--add-exports
.