# net/serviio not using openjdk8



## tuaris (Feb 23, 2015)

I upgraded the port net/serviio to 1.5 and it installed java/openjdk8 as a dependency.  However, I still have java/openjdk7 installed for other items.  How do I make serviio use the latest openjdk?

I get the following when I try to start serviio:


```
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/serviio/MediaServer : Unsupported major.minor version 52.0
  at java.lang.ClassLoader.defineClass1(Native Method)
  at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
  at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
  at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
  at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
```

My default java is still showing up as 1.7


```
java -version
openjdk version "1.7.0_76"
OpenJDK Runtime Environment (build 1.7.0_76-b13)
OpenJDK Server VM (build 24.76-b04, mixed mode)
```


```
cat /usr/local/etc/javavms
/usr/local/openjdk8/bin/java
/usr/local/openjdk7/bin/java
/usr/local/openjdk6/bin/java
```


----------



## junovitch@ (Feb 23, 2015)

According to javavm(1), this shouldn't happen.  The most native and up to date Java VM should be used.  I updated the net/serviio and didn't test this scenario.  Please add this to /usr/local/sbin/serviiod before the last line that starts Java and let me know if this works for you.  Looks good to me and if it works for you I'll work to get it added to the port.

```
JAVA_VERSION="1.8+"
export JAVA_VERSION
```


----------



## tuaris (Feb 23, 2015)

That worked for me.  

Although I still don't understand why the default Java VM is still 7 and not 8.  I don't have anything set in /usr/local/etc/javavm_opts.conf.


----------



## junovitch@ (Feb 24, 2015)

I've opened PR 198021 with the fix.  The port should be fixed soon.


----------



## Waro (Mar 19, 2015)

The serviiod fix worked for me to.


----------



## junovitch@ (Mar 20, 2015)

Waro said:


> The serviiod fix worked for me to.



Are you using the most recent ports tree?  PR 198021 was closed a week ago with the fix.  See https://svnweb.freebsd.org/ports?view=revision&revision=381171.  The Serviio version was also bumped to 1.5.1 which resolves issues in 1.5.0 with high CPU usage from scanning the media library for changes every 5 seconds.


----------

