1

after numerous tutorials, I am still unable to install JOGL. I add all of the files into a folder in the class-path then add them to the build-path, but I always get compiler errors. I have tried both Eclipse and NetBeans, both Windows 7 (64 bit) and Windows 10. I am fairly new to the world of Java, so please excuse me if this is a fairly simple mistake. Eclipse screenshot

Bob Jones
  • 37
  • 2
  • 11
  • This tutorial is obsolete, it uses an outdated version of JOGL, probably even older than JOGL 1. Use these instructions to install JOGL: http://jogamp.org/wiki/index.php/Setting_up_a_JogAmp_project_in_your_favorite_IDE#Eclipse_IDE_project – gouessej May 18 '15 at 10:14

1 Answers1

3

You need to import the GLCapabilities class from the correct package. The javax.media.opengl package for earlier versions (< 2.3.1), or the com.jogamp.opengl for more recent versions. For instance:

import javax.media.opengl.GLCapabilities;
//import com.jogamp.opengl.GLCapabilities;

...or the entire package:

import javax.media.opengl.*;//earlier versions
//import com.jogamp.opengl.*;//

See Bug 682 for information on why/when the package was renamed.

copeg
  • 8,290
  • 19
  • 28
  • When I add either of those two, I get a "The import javax.media cannot be resolved" error from Eclipse. – Bob Jones May 17 '15 at 21:22
  • That package should be within the jogl-all.jar. Expand those jar files in the package explorer (left side) to make sure they exist. – copeg May 17 '15 at 21:28
  • I could not find a javax.media, but I did find a com.jogamp.opengl.GLCapabilities. When I import it, I resolve a "GLCapabilities cannot be resolved to a type" error, but I still have a "The constructor GLCapabilities() is undefined" error. @copeg – Bob Jones May 17 '15 at 21:46
  • According to another answer here, jogl may have [renamed their packages](http://stackoverflow.com/questions/7210194/where-can-i-find-the-package-javax-media-opengl). If you found the right package, great. As for the compiler error - there isn't a no argument constructor of GLCapabilities. – copeg May 17 '15 at 21:59
  • You were right, the test code I was using was out of date. I found some more recent code with the new bindings and it worked immediately. Thanks! @copeg – Bob Jones May 18 '15 at 00:28
  • @copeg Please fix the package name, look at this bug report, we changed it in the version 2.3.1: https://jogamp.org/bugzilla/show_bug.cgi?id=682 – gouessej May 18 '15 at 10:13