Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Libraries have a problem? or is it the code? I must fix this!

  1. #1
    Junior Member
    Join Date
    Oct 2022
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Libraries have a problem? or is it the code? I must fix this!

    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:
    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);
                }
     
            }
     
        }
    }
    and here is the error that won't let me sleep:

    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)
    Last edited by Dystroyer34; November 23rd, 2022 at 02:01 PM. Reason: FIXED

  2. #2
    Junior Member
    Join Date
    Oct 2022
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Talking Re: Libraries have a problem? or is it the code? I must fix this!

    I was able to solve it, the problem was JDK19, I changed it to JDK15 and it worked

Similar Threads

  1. External libraries
    By dimacar in forum Java IDEs
    Replies: 2
    Last Post: August 1st, 2013, 07:23 AM
  2. java libraries
    By pettiville in forum The Cafe
    Replies: 1
    Last Post: June 28th, 2013, 05:35 PM
  3. How to add JSF libraries to eclipse?
    By tien1504 in forum Java IDEs
    Replies: 5
    Last Post: October 24th, 2012, 04:32 PM
  4. Using C Libraries in Java Project
    By x34 in forum Java Native Interface
    Replies: 1
    Last Post: September 25th, 2012, 02:01 PM
  5. Question about project libraries
    By xMKx in forum Java Theory & Questions
    Replies: 0
    Last Post: August 12th, 2012, 11:33 PM

Tags for this Thread