[PC-BSD Public] choosing java version

Pierre Goupil goupilpierre at gmail.com
Fri Jul 19 14:06:42 PDT 2013

I've tried tweaking /usr/local/etc/javavm_opts.conf and failed to have JDK
7 for all Java programs. If I issue "env JAVA_VERSION='1.7' java -version",
my PC-BSD 9.1 does tell that it's a JDK 7. But using env
JAVAVM_OPTS_JAVAVM_java='1.7' in the file you indicated me, or any other
things I've tried, java -version tells JDK 6.

That's annoying because I'd like every single Java process in my OS to use
JDK 7.

What am I doing wrong, please?

Kind regards,


On Fri, Jul 19, 2013 at 10:35 PM, Lars Engels <lars.engels at 0x20.net> wrote:

> On Fri, Jul 19, 2013 at 09:14:14PM +0200, Pierre Goupil wrote:
> > Good evening,
> >
> > I have installed OpenJDK 7 from the ports in my PC-BSD 9.1 and I can't
> > figure out how to tell my system to use it rather than the 6 branch.
> >
> > On Linux, I was used to use update-java-alternatives but I can't figure
> out
> > what is the equivalent.
> >
> > N.B.: I don't want to remove OpenJDK 6, just to be able to switch between
> > the two.
> >
> > Thanks in advance for any hint,
> In FreeBSD, /usr/local/bin/java is a shellscript wrapper which starts
> the actual java binary depending on /usr/local/etc/javavm_opts.conf or
> environment variables.
> For example, to start a Java 7 VM, run "env JAVA_VERSION='1.7' java"

"Un truc bien avec la musique, c'est que quand elle te frappe, tu n'as pas
Alors frappez-moi de musique !
Frappez-moi de musique, maintenant !"

(Bob Marley : "Trenchtown Rock")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pcbsd.org/pipermail/public/attachments/20130719/b84003e1/attachment.html>

More information about the Public mailing list