To install the Java Runtime Environment (JRE) run the following command:
sudo apt-get install openjdk-7-jre
This installs the Java JRE (Java Runtime Environment) which will allow you to run applications written in Java.
To install the JDK run the command:
sudo apt-get install openjdk-7-jdk
This allows you to compile Java applications to bytecode.
[Note: Later in 2013 the Pi Foundation announced Raspbian now ships with Oracle hard-float.]
The oracle 8 preview works for me, thus far. Compiling is slow on the pi, surprise, but the jre seems to run quite fast once it loads. I think bearbin's answer is pretty definitive but if you want a simple way to try oracle:
Download. You get a .tar.gz file, ...
Oracle have now released (as of Java 7u6) a JDK with JIT that works on the Pi with full AWT / Swing support. It also supports JVMTI (cacao only has partial support.) Press release here.
I've verified it works with Greenfoot, and provides a huge speedup compared to the likes of a plain (non-JIT) OpenJDK build.
At the time of writing it doesn't support hard ...
For the "lightweight" part of your question, there are a number of smaller JVMs that you might want to consider.
For instance JamVM was originally designed to work in small systems like the RP and both it and Cacao (another smaller JVM) are available as packages in debian:
though both use the open-jdk class ...
Yes, all of the B+'s GPIO pins have internal pull-up or pull-down resistors that can be controlled from your code.
Pull-up is 50K min – 65K max.
Pull-down is 50K min – 60K max.
More info on the GPIO can be found here and here.
Example usage frm the PI4J documentation:
// provision gpio pin #02 as an input pin with its internal pull down resistor enabled
Installing from the repositories should work fine on Debian:
sudo apt-get clean
sudo apt-get update
sudo apt-get install openjdk-6-jre
Java doesn't seem to be available on the Arch repo.
Can someone please edit with information for Fedora, I have no knowledge of that distro.
From looking at the log file I came across the line
INFO: HTTP Listener started: port=8080
java.io.IOException: Failed to start a listener: winstone.ssl.HttpsListener
This tells us that either the port you are using 8080 is in use but you have run netstat and established that it is not listed- so its available and not causing the exception.
I actually fixed this error going step by step, apt seems to have a bug in the way it handles ca-certificates-java and openjdk-8-jre-headless on raspbian.
So I did :
sudo apt-get remove openjdk-8-jre-headless openjdk-8-jre
sudo apt-get install ca-certificates-java
sudo apt-get install openjdk-8-jre-headless
sudo apt-get install openjdk-8-jre # Optional, ...
The filename of the installer is jdk-7u6-linux-arm-sfp.tar.gz so it's soft-float and not hard-float.
Oracle states in this press release:
One caveat is that the current binary is softfloat ABI only, so it
won't work with (for example) the Raspbian distribution which uses the
hardfloat ABI. We are planning to add hardfloat support in an upcoming
To have all the time the most recent Oracle java installed, you can do
check current Java
pi@raspberrypi:~ $ java -version java version "1.8.0_65" Java(TM) SE
Runtime Environment (build 1.8.0_65-b17) Java HotSpot(TM) Client VM
(build 25.65-b01, mixed mode)
sudo apt-get purge openjdk*
add digital key
sudo apt-key adv --recv-key --...
As you can see on Raspberry Pi FAQ, the real performance of the Raspberry Pi is something like 300 MHz Pentium 2. There is 256 MB RAM installated on both model A and B. Try to compare this parameters to the parameters of your computer.
The reason that Raspberry Pi could smoothly play BlueRay quality videos is in used Videocore 4 GPU which provides Open GL ...
A simple lightweight IDE is Geany.
apt-get install geany
Geany - support:
java syntax highlight,
geany projects to store custom javac compile and java run arguments if needed, you need to specify -classpath to include external java libraries.
one button compile/run.
I also recommend looking at DrJava, it is also a lightweight IDE written entirely in Java ...
I'm not sure about Jnode, but the Computer Laboratory at Cambridge University has a short course on OS development on the Raspberry Pi that you might be interested in:
Baking Pi - Operating Systems Development
Installing Oracle Java 7 JDK (but not JRE) hard-float for RPi is now as stunningly easy as:
sudo apt-get update && sudo apt-get install oracle-java7-jdk
I used to go through the old processes that were linked above, but since they easyfied it, now I just do this.
take a look at
for system wide configuration
for user driven configuration
furthermore you can do this:
create two files
Start Script: /usr/local/bin/jar-start.sh
Stop Script: /usr/local/bin/jar-stop.sh
java -jar myapp.jar
pid=`ps aux | grep ...
This was not possible at the time of the original question, but the full Java-based Minecraft can run on a Raspberry Pi 2 or higher today. With improvements to OpenGL on Raspbian over the years, LWJGL now just uses full OpenGL via the Mesa library.
Instructions with demo videos:
How to setup Minecraft 1.8.9 on RaspPi2 (original tutorial with Minecraft 1.8....
The system requirements for NetBeans state that it needs minimum of 512 MB of memory to run. Since the Raspberry Pi only has 256 MB of RAM, I would have to guess that there is very little chance of getting Netbeans to run. Especially considering that to run a graphical desktop, you should probably be giving the video processor 32 MB of that memory leaving ...
For video streaming, both the pi and Android can make use of DLNA via various client/server applications (on raspbian, see rygel or minidlna), although I'm not sure if those can be made to suit your purposes.
For just logging onto the pi, there are SSH clients for Android -- "Juice SSH" is good.
That should be possible in Java, as referenced here. The library which is used is called rpi-gpio-java and is available at this URL. As stated in the notes, to make it work, please make sure your application is run as root.
Note: Above project rpi-gpio-java is no longer available on google code. Alternate option is PI4J
I do not have enough score to make comments. So I'll post here:
1-"Not enough CPU"- I used to do mp3 decoding by software in a Sparc Station with a 35MHz CPU. So unless that decoder is seriously flawed it should work.
Can you do the full decode to a file? If yes measure the time it takes. If it is less that the total runtime of the song you are in business....
You won't see a big difference either way; GUI applications are actually not CPU intensive. Or at least, the GUI part of them is not; they may or may not be doing other things that are. To qualify that a bit further, if the application involves image processing or rendering special types of graphical documents (.pdf, etc.) to the screen, that's sort of an ...
Your JAVA_HOME points to a different directory than where your java executable is located. Per your question, the JAVA_HOME directory is:
whereas java is located in
Note the arm vs. arm32.
Here's your problem:
by MartenR » Thu Jul 05, 2012 11:09 am
Sound is always done on the cpu
for codecs other than the free codecs, no licenses bought for sound
decoding for mpeg audio or ac3.
The Raspberry Pi is simply not powerful enough to decode the mp3 in real time in software when running on the JVM.
You can try a few things to make it ...
Oracle have now released a developer preview of Java JDK8 for ARM which specifically includes support for hard-float Raspbian on the Pi. It works, and I have found it to be around 20 times faster than OpenJDK for certain floating point intensive computations. http://jdk8.java.net/fxarmpreview/
This is a $PATH issue. $PATH is an environment variable that contains a list of directories to search when looking for an executable. You can see your current $PATH via echo $PATH.
javac: command not found indicates javac is not in any of the directories in your $PATH. You need to add the directory with javac in it into your $PATH, or add javac to one of ...
WRT "porting" the java stuff, you shouldn't have to do much beyond, of course, installing java. There are, I think, openJDK 7 packages in raspbian, and there's a preview release of oracle 8 made with hard float for arm which works on the pi. I have not tried swing stuff with it but I would presume that it is there.
The foundation of the linux GUI is the ...