Linux

Install IntelliJ IDEA on Raspberry Pi

Posted in Linux, Programming on June 11th, 2015 by Pavel – 15 Comments

Raspberry Pi and IntelliJThis article shows how to install IntelliJ IDEA on Raspberry Pi. The instructions are also applicable for other IDEA-based IDEs like PyCharm, RubyMine, PhpStorm, WebStorm, CLion, etc.

At first, the idea of installing a full-fledged, contemporary IDE on Raspberry Pi may seem unrealizable. Raspberry Pi boards are incredibly small, so it’s hard to believe that those devices are apt for such a task. Nevertheless, in reality, Rasperry Pi can do much, much more than blinking a LED.

After trying out Scala on Raspberry Pi for some time, I configured my Rasperry Pi to run IDEA & Scala plugin for the recent ScalaDays conference. While it was initially intended to be just a “proof of concept”, it turned out that we were able to open the Scala plugin project itself (which is pretty large, and includes all IDEA CE sources) and to comfortably use this setup for most feature demonstrations. Obviously, it’s unreasonable to expect desktop-like performance from such a device, however I happen to successfully use a similar environment on EEE PC which was hardly faster.

The instructions rely on the following keystones that make the undertaking possible (and even practical):

  • Raspberry Pi 2 Model B, which offers a 900MHz quad-core CPU and 1GB of RAM (this one is for the “practical” part, yet you may try to use Rasperry Pi 1 as well).
  • Oracle JDK 8 for ARM (with HardFP, JIT and server VM), which provides >10X performance boost (comparing to Zero VM from OpenJDK).

  • Small, but essential modifications that enable IntelliJ IDEA to run on ARM systems, like Raspberry Pi (you may use the same techniques for other ARM-based microcomputers).

Update: we’ve fixed the incompatibilities, so IDEA 15 (or later) should be able to run on ARM architecture (including RaspberryPi) out-of-the-box.

Contents:

  1. Installing Java
  2. Installing IDEA
  3. Tweaking Raspberry Pi
  4. Tweaking IDEA

Some of the commands will require root privileges, so either login as root user or use sudo to start an interactive shell via sudo -i.
Continue reading →

Install Scala on Raspberry Pi

Posted in Linux, Programming, Scala on June 4th, 2015 by Pavel – 3 Comments

Raspberry Pi loves ScalaThis article shows how to install and use Scala programming language on Raspberry Pi.

Traditionally, the programming language of choice for Raspberry Pi was Python, while JVM-based languages were set aside. That was reasonable, because JVM platform is rather resource-intensive, especially in interpreted mode, and the first version of Raspberry Pi was hardly apt for such a task.

However, things have changed: on the one hand, Raspberry Pi 2 now offers a 900MHz quad-core CPU and 1GB of RAM, on the other hand, Oracle released JDK 8 for ARM (with HardFP, JIT and server VM), which provides >10X performance boost (comparing to Zero VM from OpenJDK), so Scala runs nicely even on Raspberry Pi 1 (and, RPi 2 can run IntelliJ IDEA, if you wish).

Contents:

  1. Installing Java
  2. Installing Scala
  3. Using Scala
  4. Installing SBT
  5. Using SBT

Some of the commands will require root privileges, so either login as root user or use sudo to start an interactive shell via sudo -i.
Continue reading →

Upgrade Arch Linux for Raspberry Pi 2

Posted in Linux on May 23rd, 2015 by Pavel – 17 Comments

Raspberry Pi 2 model B v1.1 (see the note below)This articles shows how to transition from Raspberry Pi to Raspberry Pi 2 without reinstalling Arch Linux.

Arch Linux ARM images are tied to specific hardware architecture. While this may be seen as an inconvenience, there is an advantage in that Arch Linux binaries for Raspberry Pi 2 are compiled for ARM7 CPU and thus can benefit from the new instruction set.

Because ARM7 architecture is backward compatible with ARM6, it’s possible to upgrade your Raspberry Pi hardware to version 2 without reinstalling Arch Linux. Here is how we can do that (it goes without saying, that if you have any important data, consider backing it up first).
Continue reading →

Access your Raspberry Pi from anywhere

Posted in Linux on May 18th, 2015 by Pavel – 27 Comments

Console to Raspberry PiRaspberry Pi is an ideal platform for setting up personal services, like Git daemon, remote backup server, proxy server… you name it. However, while the device is small and handy it is still not so portable as a server, because conventional server installation usually includes domain name registration, setting up static IP addresses and configuring port forwarding on a router.

In this article I will show you how to utilize DDNS and UPnP technologies, so you will be able to simply plug your Raspberry Pi into an Ethernet port on (almost) any router and then securely access your own services from anywhere. The instructions are also applicable to a wireless connection (just use wlan0 instead of eth0 for Wi-Fi).

In a sense, the suggested approach solves the same problem as reverse SSH tunneling, but differently — there’s no need for a “visible” IP address on client side / middle machine (however, the provider’s IP on server side must be accessible), so it’s possible to establish connection with dynamic IPs, router’s NAT on server side and NAT on client side. Besides, this method is not limited to SSH and can handle other types of connections.
Continue reading →