HowTo: Install Zulu Embedded Java on Raspberry Pi 3

[Topic updated on 10/Nov/2018 to notify users to use a manual installation method (no repos)]

Please see the following link for installation information of Azul Zulu Embedded:

Don’t use the info below anymore !

[Topic updated on 02/May/2017 to include Zulu Linux APT Repositories]


To run openHAB 2 (OH2) on a Raspberry Pi 3 (rPi3) with the standard Raspbian image, you need a working Java Runtime Environment installed on your system.

The recommended Java platform for OH2 for ARM is: Zulu Embedded (see:

Installation steps

A. Login into your rPi3, switch to root, import Azul’s public key and attach the Azul APT repository.

sudo su
apt-key adv --keyserver hkp:// --recv-keys 0x219BD9C9
echo 'deb stable main' > /etc/apt/sources.list.d/zulu.list

B. Update the information about available packages and install the Zulu Embedded (ARM32bit JDK Hard Float) package.


apt-get update -qq
apt-get install zulu-embedded-8

C. Verify the installation:

java -version

(optional step): Use the following command to make sure that the new Zulu JDK is being used as default:

update-alternatives --config java

Main Sources of info:


Great initiative @Dim! Is this a reaction to my openHABian PR? :slight_smile:

Oops :slight_smile: No… .I didn’t see it…
I will do some github stuff today. I have now some free time that the weekend is here :slight_smile:

By the way: I don’t know if we should recommend to remove any existing Java deployment (after installing Zulu) on the rPi3
Like: apt packages of: oracle-java7-jdk, oracle-java8-jdk, openjdk-8-jdk, openjdk-7-jdk, sun-java7-jdk etc etc.
What do you think?

1 Like

Thanks for the guide. But isn’t it easier to add the apt repository and work from there?

I would uninstall not used packages. But it’s my opinion ad I just get there pi running and don’t look after it until something’s wrong or when I need some extra features. Hence I want to avoid confusion having unused packages on my system.

1 Like

I didn’t find any apt repo that includes the Zulu Embedded (for ARM) package… Is there one out there?

I also prefer uninstalling old stuff from my system but it’s not mandatory (and maybe not very linux beginner friendly) since they shouldn’t interfere with the new Java installation (after someone uses with update-alternatives --config java the new Java binary)

I thought I would give this a test as I was just installing Raspian lite on my spare Raspberry pi 3. I carried out the above instructions followed by a package repository installation of Openhab using the latest snapshot.

Please to report everything went well. I then copied my live files across and all is ok except charts. None of these work and I get errors on my Habpanel charts (default or RRD4j) and the default chart that is still in the sitemap from the demo files.

2017-02-11 14:44:21.370 [WARN ] [eclipse.jetty.servlet.ServletHandler] - Error for /rrdchart.png
java.lang.NoClassDefFoundError: Could not initialize class org.rrd4j.graph.RrdGraphConstants
	at org.rrd4j.graph.RrdGraphDef.<init>(Unknown Source)[187:org.openhab.persistence.rrd4j:]
	at org.openhab.persistence.rrd4j.internal.charts.RRD4jChartServlet.createChart([187:org.openhab.persistence.rrd4j:]
	at org.openhab.persistence.rrd4j.internal.charts.RRD4jChartServlet.service([187:org.openhab.persistence.rrd4j:]
	at org.eclipse.jetty.servlet.ServletHolder.handle([81:org.eclipse.jetty.servlet:9.2.19.v20160908]
	at org.eclipse.jetty.servlet.ServletHandler.doHandle([81:org.eclipse.jetty.servlet:9.2.19.v20160908]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle([172:org.ops4j.pax.web.pax-web-jetty:4.3.0]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle([172:org.ops4j.pax.web.pax-web-jetty:4.3.0]
	at org.eclipse.jetty.servlet.ServletHandler.doScope([81:org.eclipse.jetty.servlet:9.2.19.v20160908]
	at org.eclipse.jetty.server.session.SessionHandler.doScope([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle([172:org.ops4j.pax.web.pax-web-jetty:4.3.0]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.Server.handle([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.HttpChannel.handle([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.HttpConnection.onFillable([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob([83:org.eclipse.jetty.util:9.2.19.v20160908]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$[83:org.eclipse.jetty.util:9.2.19.v20160908]

I then tried to uninstall rrd4j and re-install it and got the following:

2017-02-11 15:23:37.494 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-persistence-rrd4j'
2017-02-11 15:24:07.630 [INFO ] [.eclipse.smarthome.model.script.Demo] - Status: 0  Thermostat: 19.5  Lounge: 19.30  Hall: 19.70
2017-02-11 15:24:18.836 [INFO ] [.eclipse.smarthome.model.script.Demo] - Status: 0  H/W Thermostat: 0  Hot Water: 48.31
2017-02-11 15:25:00.046 [INFO ] [.eclipse.smarthome.model.script.Demo] - ESP 4 Error
2017-02-11 15:25:49.166 [INFO ] [basic.internal.servlet.WebAppServlet] - Stopped Basic UI
2017-02-11 15:25:50.703 [ERROR] [   ] - FrameworkEvent ERROR -
org.osgi.framework.BundleException: Exception in of bundle
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.Module.doStart([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.Module.start([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.framework.util.SecureAction.start([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.ModuleContainer.applyDelta([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.ModuleContainer.resolveAndApply([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.ModuleContainer.resolve([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.ModuleContainer.refresh([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.dispatchEvent([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.dispatchEvent([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.framework.eventmgr.EventManager$[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
Caused by: java.lang.LinkageError: ClassCastException: attempting to castbundleresource://22.fwk2402365/javax/ws/rs/ext/RuntimeDelegate.class to bundleresource://22.fwk2402365/javax/ws/rs/ext/RuntimeDelegate.class
	at org.eclipse.osgi.internal.framework.BundleContextImpl$[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.internal.framework.BundleContextImpl$[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at Method)[:1.8.0_112]
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	... 14 more
2017-02-11 15:25:51.124 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
2017-02-11 15:25:51.473 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-persistence-rrd4j': Error restarting bundles

Yup… there is something wrong with the charts…


Thanks for the prompt response. Being a ‘user’ the conversation on the github link doesn’t mean much to me. I hadn’t heard of Zulu Java until this thread but now I can see that whilst it is the preferred Java platform for Openhab, it doesn’t work on perhaps the most widely used hardware, the Raspberry Pi?

Thankfully this isn’t my live system. What do you suggest I do? Start again and use Oracle? I was actually doing this because I wanted to try the new ‘timeline’ widget in HABPanel.

The link was for the packages installation command (sorry… I replied from my Discourse (forum) client on the smart phone and couldn’t type up a proper reply)

sudo apt install libfontconfig1 fontconfig ttf-dejavu

It might be the fix to the charts issue (not sure). There are many testers (like me) who are trying to iron out these issues.

Definitely yes… that would be the safest option in this moment… :slight_smile:

1 Like

Thanks, I do appreciate the work you do on this forum. I’ll give it a try.

1 Like

It worked! After a reboot the charts are back. Many thanks.

1 Like

That’s excellent feedback! Thanx
I was planning to test myself @ThomDietrich 's solution but you beat me to the punch :slight_smile:

Hi Dim,
mere curiosity: why you would say that Zulu Embedded is the raccomended Java platform for OH2 on ARM?

Did you make any comparison with the usual Oracle SE?

To be clear: this is no provocation, I’m just really interested in your criteria.

Thanks in advance,


This was already discussed in length and you can find the details here: :wink:

Oops… sorry, I’ll take a look! :sweat_smile:

I didn’t see a clear benefit of Zulu over Oracle JDK in that link - were there some sort of performance stats in favour of Zulu over Oracle JDK on ARM?

To clarify, you can still use Oracle Java. It’s just the official recommendation by the openHAB maintainers. Let me quote what was previously said by @Kai:

The main reason is that there are “no license fees or field of use restrictions”.
Oracle JDK is (at lease on embedded systems) always subject to certain restrictions. You are actually only allowed to use it for development, but not for production. And a “pure” openHAB user probably does not really qualify as doing active development work. See

Besides that, we have done performance comparisons and there are no measurable differences (to the better or the worse). In the end, there was no downside to use and recommend a open source / free Java runtime, which is by the way also easier to install (looking at the soon to be available repository for arm).

1 Like

Dear Thom,

I must say that you are right: Oracle asks for money for each and every embedded device legally (or not) sold. The free Java runtime available is I must say (after all the missing sleep nights) a very good alternative for DIY solutions.
Not to be confusing to the openhab users: it does not in any way influence your openhab experience!

Best regards,


i think you can add zulu through repos, check my post here:

That is correct. openHABian does the same thing (see here)
@Dim would you please update your article?

1 Like