how does "javavms" work?
Greg Lewis
glewis at eyesbeyond.com
Fri May 11 14:59:05 UTC 2012
On Fri, May 11, 2012 at 02:36:12PM +0200, Alfred Bartsch wrote:
> Am 27.04.2012 20:53, schrieb Chad Leigh Shire.Net LLC:
> > Hi
> >
> > Not the behind the scenes really. Just how do I use it?
> >
> > I installed OpenJDK7 from ports. As part of that it installed the
> > Diablo stuff (Java 6).
> >
> > the /usr/local/etc/javavms file listed both. But when I edited
> > this file to only have the OKDK 7 version, it still runs the Diable
> > JDK 6 stuff when I type "java" at the command line.
> >
> > I read the man file on javavms and used registervm and unregistervm
> > and javavms only lists the OpenJDK 7 version but if I do
> >
> > # java -version java version "1.6.0_07" Diablo Java(TM) SE Runtime
> > Environment (build 1.6.0_07-b02) Diablo Java HotSpot(TM) 64-Bit
> > Server VM (build 10.0-b23, mixed mode) #
> >
>
> Normally, the Diablo stuff is installed as a build dependency to
> compile the openjdk stuff, and can safely be removed afterwards.
> But you may keep both JVMS, or you may install even some more.
> In these cases javavmwrapper kicks in and lets you choose your
> preferred JVM.
>
> Unfortunately, javavmwrapper behaves differently, whether it sees an
> installed portstree (/usr/ports/Mk/bsd.java.mk) or not.
> It is my experience that the wanted priority of JVMs due to
> /usr/local/etc/javavms is only guaranteed, if there is no portstree
> available.
>
> So I decided to patch the javavm wrapper skript
> (/usr/local/bin/javavm) to remove these unwanted features. Now
> everything works for me as expected.
>
> The attached patch file applies to an installed javavmwrapper-2.3.5
> port. You may alternatively just remove those lines from the script file.
>
> HTH
>
> P.S.: I'm thinking of filing a PR, since it looks like a bug.
It's definitely a feature rather than a bug, see javavm(1).
There are a number of knobs in the way of environment variables that you
can use to fiddle with the precedence of JVMs.
This is not to say javavm couldn't use a little updating.
--
Greg Lewis Email : glewis at eyesbeyond.com
Eyes Beyond Web : http://www.eyesbeyond.com
Information Technology FreeBSD : glewis at FreeBSD.org
More information about the freebsd-java
mailing list