I've been looking for a solution to this for a week, but I can't find it, someone here who can explain to me why this happens...
It is Java3D so it will be more difficult for them to solve it,
This is not even a code that I did, someone else did, but many people tried it and it worked,
Not only that, because I replicated a similar code but the same thing happens.
here is the code:
and here is the error that won't let me sleep:public class Cube3D implements Runnable { SimpleUniverse universe = new SimpleUniverse(); BranchGroup group = new BranchGroup(); ColorCube cube = new ColorCube(0.3); TransformGroup GT = new TransformGroup(); Transform3D transform = new Transform3D(); double Y = 0; Thread thread = new Thread(this); public Cube3D() { GT.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); thread.start(); GT.setTransform(transform); GT.addChild(cube); group.addChild(GT); universe.getViewingPlatform().setNominalViewingTransform(); universe.addBranchGraph(group); } public static void main(String[] args) { new Cube3D(); } @Override public void run() { Thread ct = Thread.currentThread(); while (ct == thread) { try { Y = Y + 0.1; transform.rotY(Y); GT.setTransform(transform); Thread.sleep(100); } catch (InterruptedException ex) { Logger.getLogger(Cube3D.class.getName()).log(Level.SEVERE, null, ex); } } } }
Exception in thread "J3D-Renderer-1" java.lang.IllegalAccessError: class javax.media.j3d.Win32NativeConfigTemplate3D (in unnamed module @0x7eeef0eb) cannot access class sun.awt.Win32GraphicsConfig (in module java.desktop) because module java.desktop does not export sun.awt to unnamed module @0x7eeef0eb
at javax.media.j3d.Win32NativeConfigTemplate3D.getBes tConfiguration(Win32NativeConfigTemplate3D.java:76 )
at javax.media.j3d.NativePipeline.getBestConfiguratio n(NativePipeline.java:3335)
at javax.media.j3d.Renderer.doWork(Renderer.java:514)
at javax.media.j3d.J3dThread.run(J3dThread.java:275)