Categories
Eclipse IoT

Running Eclipse Che on a Raspberry Pi

Eclipse Che is a very cool Eclipse technology that provides you with a browser-based IDE that can be extended with plug-ins for virtually any language, framework, or tool that you may want to use in your day-to-day development.

This means that, right from your browser, you can do Java development and have Maven automatically build your stuff, or do Javascript development and still be able to easily integrate with e.g grunt to build your website.

As you may have guessed, most of the magic of Che is in its server. While in many cases you will run the Che server on your own laptop or private server, it’s also pretty cool to run it on an embedded/IoT device such as Raspberry Pi so as not only you have an “IDE-in-a-box” setup, but you can also actually develop code targeting the Pi itself. And yes, that means blinking LEDs… and more ! 😉

Install Docker

Assuming you are running an up-to-date Jessie distribution, it should be fairly straightforward to install the armhf version of docker provided by the Hypriot team.

cd ~/Downloads
wget https://downloads.hypriot.com/docker-hypriot_1.10.3-1_armhf.deb
sudo dpkg -i docker-hypriot_1.10.3-1_armhf.deb
sudo usermod -aG docker pi

At this point, you want to quickly logout and login again, in order for the addition of the user pi to the docker group to be properly applied. Then, we can test that docker is indeed running:

docker ps

This should grant you with an empty list of running docker containers. How surprising!? But at least it means you have Docker setup taken care of!

FWIW, the Hypriot folks have a Debian repo for making things easier. I have had problems with it though so you may want to stay away from it until they fix it?

Downloading Che

wget https://install.codenvycorp.com/che/eclipse-che-latest.zip
unzip eclipse-che-latest.zip
cd eclipse-che*

Updating Che’s built-in stacks to be ARM-compatible

When Che creates your development environment, it instantiates a Docker container that has the tools you need. That is to say, if you are to do Node development, Che can provision a so-called “stack” that contains npm, grunt, etc. The stacks configured by default in Che are based on x86 Docker images, so you will need to replace them with armfh-compatible ones.

sed -i 's/codenvy\/ubuntu_jdk8/kartben\/armhf-che-jdk8/g' stacks/predefined-stacks.json
sed -i 's/codenvy\/node/kartben\/armhf-che-node/g' stacks/predefined-stacks.json

I’ve built an image for Java and Node development, which means you’ll be able to use the “Java”, “Node”, and “Blank” ready-to-go stacks. Should you want to have a look at the Dockerfiles for those, see here.

Note that you don’t have to use the built-in stacks, and you can also create your on-the-fly, using a custom recipe. There as well, the base Docker image you’re building from will need to be ARMHF. You may want to use images from hypriot or armv7 on DockerHub.

Update other default settings

The Raspberry Pi 3 is quad-core, which means you actually get some very decent performances out of it. However, it’s still an embedded sort of device, and SD cards are typically not fast either. It’s a good idea to increase the timeout Che uses to detect a workspace is properly provisioned.

sed -i 's/machine.ws_agent.max_start_time_ms=60000/machine.ws_agent.max_start_time_ms=240000/g' conf/che.properties

Launch Che!

You’re good to go! All that is left is to launch Che. As you will likely be accessing it from e.g your Desktop computer, you need to make sure to use the -r:<external-IP> command-line argument to make sure it works properly from “non-localhost”:

./bin/che.sh run -r:192.168.2.26

Note that depending on your setup, the JAVA_HOME environment variable may not be set, in which case Che will complain, and you will have to first set the said environment variable:

export JAVA_HOME=/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt

You can actually add this to your ~/.bashrc to make sure JAVA_HOME is always set.

That’s it! You can now use the Java and Node stacks, and start using your web browser to develop right on your Pi, with *all* the features you would expect from a “real” IDE. Enjoy, and stay tuned for a video tutorial soon.

By Benjamin Cabé

Benjamin Cabé is a technology enthusiast with a passion for empowering developers to build innovative solutions. He has invented an award-winning open source and open hardware artificial nose that he likes to use as an educational platform for people interested in diving into the world of embedded development.
He is currently a Developer Advocate for the Zephyr Project at the Linux Foundation and lives near Toulouse, France, where he enjoys baking sourdough bread with the help of his artificial nose.

22 replies on “Running Eclipse Che on a Raspberry Pi”

Hi,
I followed these steps one by one, and when I try to launch Che I get this error :

!!!
!!! JAVA_HOME is not set. Please set to directory of JVM or JRE.
!!!

Please help 😛 !

Hi Mehdi,

You are right, it’s missing. Sorry about that! Before launching Che you should make sure to do the following:

export JAVA_HOME=/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt

I am running on a raspberry pi 3, I have followed all the steps and I am trying to launch it using the browser http://localhost:8080 and it’s taking a real long time — the screen is just showing a 3 bars in animation. Nothing in the log. How long does it usually take to load up?

Before running the Che serveur, you need to start docker : sudo service docker start

Thanks for gr8 article. can I do cpp development using armhf-che-jdk8 or armhf-che-node

Very good article! I managed to install and run Eclipse Che, however, I’m using the Raspberry Pi 3 as server AND client (among the browsers I tried, Midori is the only one that works) so I run the command ”’./bin/che.sh run”’ for local usage, without informing an ip.
Anyway, I get an error while “Starting workspace agent”. The error says “Client has aborted connection. Response writing omitted.”.
Maybe the Raspberry Pi 3 has not enough memory for running both the server and client?

my user is already in the docker group.

$ groups
lp wheel http mysql video audio optical storage power users docker

Ah, sorry that I misread. Did you you logout/login to make sure to apply the changes to your groups?

I am getting the following error after running sed:

pi@raspberrypi:~/eclipse-che-4.4.2 $ sed -i ‘s/codenvy\/ubuntu_jdk8/kartben\/armhf-che-jdk8/g’ stacks/predefined-stacks.json

sed: can’t read stacks/predefined-stacks.json: No such file or directory

First of all, thanks a lot for the tutorial, the Java & Node images, and the idea of turning my Pi into a Che server !

Thanks to your guidance, I got Che running on my Pi 3 relatively quickly.

However, when I try to run a Java workspace (using the ready-to-go Java stack), it fails due to memory allocation for the VM :

[DOCKER] Status: Image is up to date for kartben/armhf-che-jdk8:latest
[DOCKER] Step 1 : FROM kartben/armhf-che-jdk8
[DOCKER] —> 15fd9487b6f0
[STDOUT] Error occurred during initialization of VM
[STDOUT] Could not reserve enough space for 2097152KB object heap

Now, I’m familiar with Java but not so much with Docker, and I’m having a hard time finding where this parameter is passed. Any tips or pointers greatly appreciated!

@Mars : In later Che builds (mine is 4.6.2), there is indeed no predefined-stacks.json file anymore.

In Kartben’s tutorial and command lines, simply replace predefined-stacks.json by stacks.json, and it’ll work (it did for me).

Nevermind, it was in che.properties :
# Java command line options when starting our Che agent in workspace runtime
che.machine.java_opts=-Xms256m -Xmx2048m -Djava.security.egd=file:/dev/./urandom

Sorry for the spam!

Hi. Trying to create a new Workspace for PHP development it fails starting up with message: System error: exec format error

Do I need to set it up for ARM? How can I do?

Thank you very much

I followed your Tut …
bash che.sh run -r:$ip
… starts and only warns about
“[ WARN ] [p.DockerExtConfBindingProvider 51] – DockerExtConfBindingProvider”

But http://$ip:8080 only returns a 404 …
“description The requested resource is not available. /dashboard”

Plz help!

If it doesn’t work for somebody, in the newest version you must execute

sed -i ‘s/eclipse\/node/kartben\/armhf-che-node/g’ stacks/stacks.json
sed -i ‘s/eclipse\/ubuntu_jdk8/kartben\/armhf-che-jdk8/g’ stacks/stacks.json

instead of

sed -i ‘s/codenvy\/ubuntu_jdk8/kartben\/armhf-che-jdk8/g’ stacks/predefined-stacks.json
sed -i ‘s/codenvy\/node/kartben\/armhf-che-node/g’ stacks/predefined-stacks.json

Leave a Reply

Your email address will not be published. Required fields are marked *