shader problems

how do i get a shader loaded into JOGL and check the status?
here’s my current code

public void setupshaders(GL gl)
	{
		String frag = "test.frag";
		String vert ="test.vert";
	       int v = gl.glCreateShader(GL.GL_VERTEX_SHADER);
	        int f = gl.glCreateShader(GL.GL_FRAGMENT_SHADER);
	        
	        shader(gl,v,vert);
	        shader(gl,f,frag);
	     
	        int shaderprogram = gl.glCreateProgram();
	        gl.glAttachShader(shaderprogram, v);
	        gl.glAttachShader(shaderprogram, f);
	        gl.glLinkProgram(shaderprogram);
	        gl.glValidateProgram(shaderprogram);
	        System.out.println(gl.glGetString(GL.GL_VERSION));
	        gl.glUseProgram(shaderprogram);
	}
	
	
	
	public  void shader(GL gl, int shadernum, String file)
    {
    	 String fshadername=file;
    	 BufferedReader shader= new BufferedReader(new InputStreamReader(new BufferedInputStream(getClass().getResourceAsStream(fshadername))));

    	

    	  
    	  String tempstring="";
    	  Vector<String> shaderstringsvector= new Vector();
    	 while(true)
    	 {
    	 try {
    	 	tempstring=shader.readLine();
    	 } catch (IOException e) {
    	 	// TODO Auto-generated catch block
    	 	e.printStackTrace();
    	 }

    	 if(tempstring==null)
    	 {
    	 	break;
    	 }

    	 shaderstringsvector.add(tempstring);	
    	 }

    	 String shaderstrings[]= new String[shaderstringsvector.size()];
    	 int shaderlengths[]= new int[shaderstringsvector.size()];

    	 for(int x=0;x<shaderstringsvector.size();x++)
    	 {
    	 	shaderstrings[x]=shaderstringsvector.get(x);
    	 	shaderlengths[x]=shaderstringsvector.get(x).length();

    	 }
    	      
    	 gl.glShaderSource(shadernum, 1, shaderstrings, shaderlengths, 1);
gl.glCompileShader(shadernum);


    } 
    
}

how do i check the compile status and such? because i keep getting the exception

Exception in thread “AWT-EventQueue-0” javax.media.opengl.GLException: glGetError() returned the following error codes after a call to glUseProgram(): GL_INVALID_OPERATION
at javax.media.opengl.DebugGL.checkGLGetError(DebugGL.java:12715)
at javax.media.opengl.DebugGL.glUseProgram(DebugGL.java:9774)
at shaders.shader1.setupshaders(shader1.java:228)
at shaders.shader1.init(shader1.java:76)
at com.sun.opengl.impl.GLDrawableHelper.init(GLDrawableHelper.java:72)
at javax.media.opengl.GLCanvas$InitAction.run(GLCanvas.java:418)
at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:189)
at javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:412)
at javax.media.opengl.GLCanvas.display(GLCanvas.java:244)
at javax.media.opengl.GLCanvas.paint(GLCanvas.java:277)
at sun.awt.RepaintArea.paintComponent(RepaintArea.java:248)
at sun.awt.RepaintArea.paint(RepaintArea.java:224)
at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:301)
at java.awt.Component.dispatchEventImpl(Component.java:4486)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

what’s wrong here?

There is an example of shaders here (JOGL 2):

Ok but should i use JOGL2? aparrently some things are still broken and it hasn’t even been released yet. should i wait for a release or just go ahead?

what the heck i’ll just try it.

JOGL 2 is stable enough to do lots of things. I still have some freezes on Windows and Linux :frowning: Try it and tell us what is wrong.

if i even try a simple blank window the exception

Exception in thread “main” java.lang.UnsatisfiedLinkError: com.jogamp.common.os.Platform.getPointerSizeInBitsImpl()I
at com.jogamp.common.os.Platform.getPointerSizeInBitsImpl(Native Method)
at com.jogamp.common.os.Platform.(Platform.java:65)
at com.jogamp.common.nio.Buffers.nativeOrder(Buffers.java:252)
at com.jogamp.common.nio.Buffers.newDirectByteBuffer(Buffers.java:67)
at com.jogamp.common.jvm.JVMUtil.(JVMUtil.java:58)
at javax.media.nativewindow.NativeWindowFactory.(NativeWindowFactory.java:102)
at javax.media.opengl.GLProfile.initProfiles(GLProfile.java:855)
at javax.media.opengl.GLProfile.access$000(GLProfile.java:59)
at javax.media.opengl.GLProfile$1.run(GLProfile.java:989)
at java.security.AccessController.doPrivileged(Native Method)
at javax.media.opengl.GLProfile.(GLProfile.java:987)
at test.main(test.java:10)

shows up. what’s wrong here?