Spring Exception: Spring boot package org.springframework.boot is not visible
DemoApplication.java: package org.springframework.boot is not visible.
(package org.springframework.boot is declared in the unnamed module, but module demo does not read it
Fix: Please delete the module-info.java file which is created by the IDE automatically and try again.
Sample Log:
[INFO] Scanning for projects...
[INFO]
[INFO] [1m--------------------------< [0;36mcom.example:demo[0;1m >--------------------------[m
[INFO] [1mBuilding demo 0.0.1-SNAPSHOT[m
[INFO] from pom.xml
[INFO] [1m--------------------------------[ jar ]---------------------------------[m
[INFO]
[INFO] [1m--- [0;32mresources:3.3.1:resources[m [1m(default-resources)[m @ [36mdemo[0;1m ---[m
[INFO] Copying 1 resource from src\main\resources to target\classes
[INFO] Copying 0 resource from src\main\resources to target\classes
[INFO]
[INFO] [1m--- [0;32mcompiler:3.11.0:compile[m [1m(default-compile)[m @ [36mdemo[0;1m ---[m
[INFO] Changes detected - recompiling the module! :input tree
[INFO] Compiling 2 source files with javac [debug release 17 module-path] to target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/admin/Downloads/demo/src/main/java/com/example/demo/DemoApplication.java:[3,27] package org.springframework.boot is not visible
(package org.springframework.boot is declared in the unnamed module, but module demo does not read it)
[ERROR] /C:/Users/admin/Downloads/demo/src/main/java/com/example/demo/DemoApplication.java:[4,32] package org.springframework.boot.autoconfigure is not visible
(package org.springframework.boot.autoconfigure is declared in the unnamed module, but module demo does not read it)
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] [1m------------------------------------------------------------------------[m
[INFO] [1;31mBUILD FAILURE[m
[INFO] [1m------------------------------------------------------------------------[m
[INFO] Total time: 2.215 s
[INFO] Finished at: 2023-11-30T11:22:46+05:30
[INFO] [1m------------------------------------------------------------------------[m
[ERROR] Failed to execute goal [32morg.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile[m [1m(default-compile)[m on project [36mdemo[m: [1;31mCompilation failure[m: Compilation failure:
[ERROR] /C:/Users/admin/Downloads/demo/src/main/java/com/example/demo/DemoApplication.java:[3,27] package org.springframework.boot is not visible
[ERROR] (package org.springframework.boot is declared in the unnamed module, but module demo does not read it)
[ERROR] /C:/Users/admin/Downloads/demo/src/main/java/com/example/demo/DemoApplication.java:[4,32] package org.springframework.boot.autoconfigure is not visible
[ERROR] (package org.springframework.boot.autoconfigure is declared in the unnamed module, but module demo does not read it)
[ERROR] -> [1m[Help 1][m
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the [1m-e[m switch.
[ERROR] Re-run Maven using the [1m-X[m switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [1m[Help 1][m http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Get Updates
Subscribe to our e-mail to receive updates.
0 Responses to “Spring Exception: Spring boot package org.springframework.boot is not visible”
Post a Comment
Thanks for your comments