# Jetty9 FreeBSD 10-2



## edisonch (Aug 20, 2016)

Dear forum,

I am having quite a problem with using Jetty9 in FreeBSD 10-2. The error message below always pop up every time I use: `service jetty start`

```
Starting jetty.
Cannot find a Java JDK. Please set either set JAVA or put java (>=1.5) in your PATH.
/usr/local/etc/rc.d/jetty: WARNING: failed to start jetty
```

Even when I export JAVA_HOME for bash shell it still can't find java.
However if I just type `java` then enter, FreeBSD will respond with the java output just fine.
I am using openjdk8 and I have set JAVA_HOME to that directory but jetty9 still has not found the java.


----------



## tobik@ (Aug 20, 2016)

edisonch said:


> Even when I export JAVA_HOME for bash shell it still can't find java.


service(8) clears the environment before executing a rc.d script, so it never sees JAVA_HOME.

www/jetty9 works fine on FreeBSD 10.3 for me. You could try setting JAVA in /usr/local/etc/jetty/jetty:

```
JAVA=/usr/local/openjdk8/bin/java
```


----------



## edisonch (Aug 22, 2016)

thank you so much. It works as you said. Jetty9 has different way of doing things than previous version.


----------

