Replies: 1 comment
-
From the error message:
it sounds like there is an export clause missing in your You probably need to add a line like this: exports com.example.myprojectraspi; and maybe other exports if spring needs to access other classes inside your app. Not a Pi4J issue, but I hope this helps :-). Thanks, Robert |
Beta Was this translation helpful? Give feedback.
-
Hi everyone!
I'm creating spring boot app, but i have a problem to run app with all dependencies.
pi@raspberrypi:~/Desktop/distribution $ sudo ./run.sh
Exception in thread "restartedMain" java.lang.IllegalAccessException: class org.springframework.boot.devtools.restart.RestartLauncher (in module spring.boot.devtools) cannot access class com.example.myprojectraspi.MyProjectRaspiApplication (in module com.example.myprojectraspi) because module com.example.myprojectraspi does not export com.example.myprojectraspi to module spring.boot.devtools
at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:385)
at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:687)
at java.base/java.lang.reflect.Method.invoke(Method.java:559)
at [email protected]/org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
module-info.java
module com.example.myprojectraspi {
// Pi4J MODULES
requires com.pi4j;
requires com.pi4j.plugin.pigpio;
}
Pom
4.0.0
org.springframework.boot
spring-boot-starter-parent
2.5.2
com.example
MyProjectRaspi
0.0.1-SNAPSHOT
MyProjectRaspi
Demo project for Spring Boot
jar
<java.version>11</java.version>
<slf4j.version>2.0.0-alpha0</slf4j.version>
<pi4j.version>2.0-SNAPSHOT</pi4j.version>
I don't know whats wrong. Anyone could help?
Beta Was this translation helpful? Give feedback.
All reactions