Search code examples
javaeclipsejogl

Eclipse does not recognize package Import? JOGL


i have jogl in the path and this program works fine until i include "import net.java.games.jogl.*;" on the top of the code. I get error "Import cannot be resolved" As i told you it works without the import. The Native Libraries are installed and jogl.jar is installed. Why isnt Eclipse recognizing this package import? here is the code:

import net.java.games.jogl.*;
public class HelloWorld
    { // open HelloWorld

        public static void main(String[] args)
        { // open main
            try
            { // open try
                System.loadLibrary("jogl");
                System.out.println("Hello World! (The native libraries are installed.)");
            } // close try
            catch (Exception e) // all try's need a catch
            { } // even if the catch does nothing
        } // close main

    } // close HelloWorld

Solution

  • It appears that the example you are working from is using an outdated package name. Take a look at the contents of the jar to determine the correct package.

    This link (from 2006) is suggesting you may want to look at the package javax.media.opengl. Also, here is some javadoc for jogl that I found. I am not sure how up to date it is though...