Replies: 1 comment
-
Hi, you are doing everything correctly. This appears to be a bug in that MassData is not exposed to the outside world. I'll open an issue so it gets tracked. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Pretty new here. Followed one of the YT vids. Got a basic app running. Can run
mvn javafx:jlink
to produce stand-alone app.In order to do that I had to add a module-info.java file like this:
Now I'm tinkering around with MassData. If I try to launch the app I get this when launching from within IntelliJ or from the command-line with mvn javafx:run:
21:19:48.144 [JavaFX Application Thread] INFO Engine - FXGL-21.1 (27.03.2024 07.52) on WINDOWS (J:21.0.3 FX:21.0.1) 21:19:48.145 [JavaFX Application Thread] INFO Engine - Source code and latest versions at: https://github.com/AlmasB/FXGL 21:19:48.145 [JavaFX Application Thread] INFO Engine - Ask questions and discuss at: https://github.com/AlmasB/FXGL/discussions 21:19:48.145 [JavaFX Application Thread] INFO Engine - Join the FXGL chat at: https://gitter.im/AlmasB/FXGL 21:19:48.624 [FXGL Background Thread 1 ] INFO FXGLApplication - FXGL initialization took: 0.324 sec 21:19:48.722 [JavaFX Application Thread] FATAL FXGLApplication - Uncaught Exception: java.lang.RuntimeException: Initialization failed at com.almasb.fxgl.all@21.1/com.almasb.fxgl.app.FXGLApplication$InitAppTask.failed(FXGLApplication.kt:347) at javafx.graphics@21.0.1/javafx.concurrent.Task.setState(Task.java:710) at javafx.graphics@21.0.1/javafx.concurrent.Task$TaskCallable.lambda$call$2(Task.java:1429) at javafx.graphics@21.0.1/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456) at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) at javafx.graphics@21.0.1/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455) at javafx.graphics@21.0.1/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) at javafx.graphics@21.0.1/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics@21.0.1/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:185) at java.base/java.lang.Thread.run(Thread.java:1583) Caused by: java.lang.IllegalAccessError: class com.doug.game.SimpleFactory (in module com.doug.main) cannot access class com.almasb.fxgl.physics.box2d.collision.shapes.MassData (in module com.almasb.fxgl.entity) because module com.almasb.fxgl.entity does not export com.almasb.fxgl.physics.box2d.collision.shapes to module com.doug.main at com.doug.main@0.0.1-SNAPSHOT/com.doug.game.SimpleFactory.lambda$newAlly$0(SimpleFactory.java:38) at com.almasb.fxgl.entity@21.1/com.almasb.fxgl.physics.PhysicsComponent.onInitPhysics(PhysicsComponent.java:64) at com.almasb.fxgl.entity@21.1/com.almasb.fxgl.physics.PhysicsWorld.createBody(PhysicsWorld.java:562) at com.almasb.fxgl.entity@21.1/com.almasb.fxgl.physics.PhysicsWorld.onPhysicsEntityAdded(PhysicsWorld.java:125) at com.almasb.fxgl.entity@21.1/com.almasb.fxgl.physics.PhysicsWorld.onEntityAdded(PhysicsWorld.java:119) at com.almasb.fxgl.entity@21.1/com.almasb.fxgl.entity.GameWorld.notifyEntityAdded(GameWorld.kt:233) at com.almasb.fxgl.entity@21.1/com.almasb.fxgl.entity.GameWorld.add(GameWorld.kt:96) at com.almasb.fxgl.entity@21.1/com.almasb.fxgl.entity.GameWorld.addEntity(GameWorld.kt:85) at com.almasb.fxgl.entity@21.1/com.almasb.fxgl.entity.GameWorld.spawn(GameWorld.kt:397) at com.almasb.fxgl.entity@21.1/com.almasb.fxgl.entity.GameWorld.spawn(GameWorld.kt:384) at com.almasb.fxgl.all@21.1/com.almasb.fxgl.dsl.FXGL$Companion.spawn(FXGL.kt:566) at com.almasb.fxgl.all@21.1/com.almasb.fxgl.dsl.FXGL.spawn(FXGL.kt) at com.doug.main@0.0.1-SNAPSHOT/com.doug.game.SimpleGameApp.initGame(SimpleGameApp.java:21) at com.almasb.fxgl.all@21.1/com.almasb.fxgl.app.FXGLApplication$InitAppTask.initGame(FXGLApplication.kt:343) at com.almasb.fxgl.all@21.1/com.almasb.fxgl.app.FXGLApplication$InitAppTask.call(FXGLApplication.kt:321) at com.almasb.fxgl.all@21.1/com.almasb.fxgl.app.FXGLApplication$InitAppTask.call(FXGLApplication.kt:313) at javafx.graphics@21.0.1/javafx.concurrent.Task$TaskCallable.call(Task.java:1399) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ... 1 more
If I get rid of module-info.java it runs fine. I'm kind of clueless about how to resolve this. Do I need to add something to module-info.java?
Beta Was this translation helpful? Give feedback.
All reactions