You really need to learn how to search for error fixes...
Whenever you get an OpenGLException, simply search for the name of the method which throws it, in this case
Then open the OpenGL Reference page link (usually 1st in Google search (I searched "glGetProgram")), and the paper contains the point "Errors", where you see whats the problem with each type of Error:
GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.
GL_INVALID_OPERATION is generated if program does not refer to a program object.
GL_INVALID_OPERATION is generated if pname is GL_GEOMETRY_VERTICES_OUT, GL_GEOMETRY_INPUT_TYPE, or GL_GEOMETRY_OUTPUT_TYPE, and program does not contain a geometry shader.
GL_INVALID_ENUM is generated if pname is not an accepted value.
We search for our error: In your stacktrace lwjgl tells us 'Invalid operation', and there in the manual page it is: GL_INVALID_OPERATION.
Now whats the problem? The error is generated, if the program does not refer to a program object.
You never called
it seems. Or at least it's return value is not what you give to check the log info...
Try to print 'obj' in your code. If it's <= 0, then something is wrong.
Also, use davedes' code. Or try out his tutorial
. He explains it very well.
<edit>Fixed 'glGetProgram' to 'glCreateProgram'...</edit>