Fiji command unable to find JOGL library - minimal example

maven
fiji
Tags: #<Tag:0x00007fd542fa36a0> #<Tag:0x00007fd542fa3538>

#21

This would be quite a hacky workaround… But of course it’s possible, using the ScriptService, somewhat along these lines:

@Parameter
private ScriptService scripts;

private final String script = """
import com.jogamp.newt.NewtFactory
import com.jogamp.newt.opengl.GLWindow
import com.jogamp.opengl.GL
import com.jogamp.opengl.GL2
import com.jogamp.opengl.GLAutoDrawable
import com.jogamp.opengl.GLCapabilities
import com.jogamp.opengl.GLProfile

glProfile = GLProfile.get(GLProfile.GL2)
glCapabilities = new GLCapabilities(glProfile)
"""
scripts.run("foo.groovy", script, true).get();

#22

Yeah, native stuff is quite a pain.

Which version of JOGL is this code known to work with? This looks like a version mismatch thing, so perhaps this direction is just going to lead to dealing with other issues.

So answering your last question:

the ImageJ class has a method: script() that returns a ScriptService

You can then specify the script using run http://javadoc.imagej.net/SciJava/org/scijava/script/ScriptService.html#run-java.io.File-boolean-java.util.Map-

Arg, @imagejan beat me!

Note that in @imagejan’s example, the file extension is used to detect the language, but the file is never created.


#23

I assume that a very basic JOGL version should do the trick :

But I don’t exactly know which version is strictly required.

But anyway I will try the script trick.

FYI @kephale I also branched SciView and I’m going through initial testings. So far I can’t display a cube but I have good hope :wink:


#24

Feel free to complain loudly about issues you have with SciView!


#25

:smile:
Ok, where do you prefer ? Gitter, here, in another forum thread, … ?


#26

Another forum thread would be the best spot, and gitter for quick things (which is hard to judge because who knew natives could be such a pain :wink:


#27

And I guess github issues for specific issues, no?


#28

Yes, we are like therapists, issues are our power source!


#29

And the “cleanest commit 2017” prize goes to …

TA DAA!

https://github.com/NicoKiaru/MinJOGLCmd/commit/46d4c4ad3bf6f3dd1c7bf297fe5cffc79f703eaf

Mistakes are even included in the commit message to highlight the incredible beauty of this solution.

… at least it works


#30

/me raises hand :tired_face: :dizzy: :hurtrealbad: :feelsgood: