when do I need to set JAVA_HOME?

Anton Shterenlikht mexas at bris.ac.uk
Mon Apr 4 11:04:13 UTC 2016

I'm having troubles running an openGL
3D visualisation over ssh -Y:

javax.media.opengl.GLException: Error making context current
        at com.sun.opengl.impl.x11.X11GLContext.makeCurrentImpl(X11GLContext.java:141)
        at com.sun.opengl.impl.x11.X11OnscreenGLContext.makeCurrentImpl(X11OnscreenGLContext.java:69)
        at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:127)

The X server is on FreeBSD 11-current.

It was suggested to me
to double check Java setup.

I have installed

$ pkg info -xo jdk
linux-oracle-jdk18-8.77        java/linux-oracle-jdk18
openjdk8-8.77.3                java/openjdk8

Both ports rely on java/javavmwrapper, which installs
symlinks under /usr/local/bin, all pointing to

So is it not recommended to invoke binaries from either
of the above ports directly?
Will these be invoked
somehow via /usr/local/bin/javavm?

The javavm(1) man page lists multiple env var, e.g.
JAVA_HOME, JAVA_OS, none of which I have set.

So I'm unsure:

1. If I have only a single JDK port installed,
do I need to set any env vars or anything else up
to be able to use Java?

2. If I have multiple JDK installed, as above,
how do I choose which one is used?



More information about the freebsd-questions mailing list