Saturday, January 18, 2014

Installing Java on your Beaglebone Black

There's a complete guide here.

Once you have a visual interface, things go much smoother:


  • Download java for embedded devices from oracle.
    (Choose a softFP, client version, headless/headful = without or with some extra api's, so why not headful)
  • Copy the file to a new 'java' folder in the usr folder
  • Extract the archive (from putty or terminal):
    'tar xzf ejre...' (depends on the version you downloaded)
  • Check if it has extracted properly
  • Set environment variables: (also putty or terminal)export PATH=$PATH:/usr/java/ejreXXXXX/bin/
    export JAVA_HOME=/usr/java/ejreXXXXX/
    (Swap XXXXX for the version you installed, so the folder name you extracted)
  • Check if it's installed properly: (putty/terminal)
    java -version 
 To make the installation stick, we need to add these last commands into a shell, running at startup (like the VNC script)

Actually we can throw it all together so it would all look a bit like this:
#Startup Commands
#Java
export PATH=$PATH:/usr/java/ejre1.7.0_51/bin/
export JAVA_HOME=/usr/java/ejre1.7.0_51/

export PATH=$PATH:/usr/java/jdk1.7.0_51/bin/
export JAVA_HOME=/usr/java/jdk1.7.0_51/

#VNC initialisation
x11vnc -bg -o %HOME/.x11vnc.log.%VNCDISPLAY -auth /var/run/gdm/auth-for-gdm*/database -display :0

 (replace by your own java version!!)

I placed this in in a folder named 'shell' in the 'bin' folder and named the file 'startup.sh'. This file should be added to the startup applications of your BBB.

Issue on ubuntu:
No such file or directory

Thow this into your terminal to fix it:
sudo apt-get install libc6-*




No comments:

Post a Comment