# OpenJDK6 - Diablo JDK Switch?



## divdev (Jan 25, 2012)

Hi, I have openjdk6 and diablo installed (diablo was a dependency to install openjdk6), *java -version* returns diablo and I want to switch to openjdk, I found this post: Cannot switch java VM but don't know what to do, the /usr/ports/Mk/bsd.java.mk seems to have been updated but don't seems to work. Tried:


```
unregistervm /usr/local/diablo-jdk1.6.0/bin/java
```

also tried commenting diablo on javavms with no success.

FreeBSD 9 RELEASE running jails with ezjails, trying to run jira on tomcat 6, it's running but have some errors during installation and on every startup (don't have these problems running on centos), want to ditch the box and switch to FreeBSD.

Appreciate any help.
TIA.


----------



## SirDice (Jan 25, 2012)

This should do the trick, add to /etc/make.conf:

```
JAVA_PREFERRED_PORTS?=JAVA_PORT_NATIVE_OPENJDK_JDK_1_6
```


----------



## divdev (Jan 25, 2012)

Sir Dice thanks, I have found the answer on the forum:

in /etc/make.conf I've put

```
JAVA_VERSION=1.6
JAVA_VENDOR=openjdk
```

I've tried putting it in /etc/rc.conf, anyway it's working now and I can switch easy on the fly. I've thought make.conf was only used when building something with make.

Thanks.


----------



## SirDice (Jan 25, 2012)

divdev said:
			
		

> I've thought make.conf was only used when building something with make.


That was my first thought too. But it seems there are a few switches/options that also change parameters for the running system.

I found this one while experimenting with java myself and ran into the same problem, how the heck do you switch which JRE is used?


----------

