Close

Setting up Oracle Java 8, Gradle, and Maven On Beaglebone Green

avrAVR wrote 09/24/2015 at 01:41 • 2 min read • Like

To install the latest ARM Java 8 JDK release I hade to manually install it with the following process:

  1. First on your local machine download the latest Java 8 package for Linux ARM v6/v7 Hard Fload ABI found here:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
  2. Open up a Terminal session on your local machine
  3. Copy the Java archive to the home directory of the root user on your Beaglebone Black/Green. Open up a Terminal session on your local machine and type with the following command:
     sudo scp /path/to/java/archive root@192.168.7.2:/path/to/user/home
  4. Once the file has finished copying over to the home directory of your user account on the Beaglebone open up a Terminal session and SSH into the Beaglebone
  5. Once inside the SSH session on the Beaglebone make sure you are in he home directory and unpack the java archive:
    cd /~
    gunzip jdk-8-linux-arm-vfp-hflt.tar.gz
  6. Copy Upack the tar into the /usr directory:
    sudo tar xf jdk-8-linux-arm-vfp-hflt.tar -C /usr
  7. Next update the Java path by adding the following lines to the .bashrc file
    sudo nano ~/.bash_profile
    Add the follownig to the ~/.bash_profile and save it
    #### JAVA 1.8.0 #######################
        export JAVA_HOME=/usr/jdk1.8.0_60
        export PATH=$PATH:$JAVA_HOME/bin
     #### JAVA 1.8.0 #######################
    Then run
    source ~/.bash_profile
  8. Finally to test the install and check the Java version:
    java -version
    It should print back something like this:
    java version "1.8.0_60"
    Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
    Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode)

So yeah after some hacking away at the terminal Java is installed on the Beaglebone. Now since this project is utilizing BowlerStudio and it would make sense to be able to pull and build BowlerStudio from the git repo right on the Beaglebone. In order to build BowlerStudio in the shell from source, not only is Java required but also Maven and Gradle, I will go over the process I went to install them below:

Installing Maven 3.3.3 on the Beaglebone Green:

  1. Open a Terminal session
  2. SSH into the Beaglebone using user account.
  3. Now download the latest build of Maven 3.3.3
    cd /tmp
    sudo wget http://apache-mirror.rbc.ru/pub/apache/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
  4. Now to unpack the archive, create the install directory, and move the contents of the archive tot he directory
    sudo tar -xvzpf apache-maven-3.3.3-bin.tar.gz
    sudo mkdir -p /opt/maven/3.3.3
    sudo mv apache-maven-3.3.3/* /opt/maven/3.3.3/
    sudo ln -s /opt/maven/3.3.3/ /opt/maven/current
  5. Now to add the proper PATH, open your bash profile:
  6. sudo nano ~/.bash_profile
    Add the following to the File below the Java entry :
    #### MAVEN 3.3.3 #########################
    
        export MAVEN_HOME=/opt/maven/current
        export PATH=$PATH:$MAVEN_HOME/bin
    
    #### MAVEN 3.3.3 #########################
    Then run
    source ~/.bash_profile
  7. Test Installation and Check Version
    mvn -version

Installing Gradle on the Beaglebone Green

  1. Open a Terminal session
  2. Access the Beaglebone over SSH under the user account you created earlier inthe tutorial
    ssh your-username@192.168.7.2
  3. Now download the latest Gradle
    cd /tmp
    sudo wget https://services.gradle.org/distributions/gradle-2.7-all.zip
  4. Now to unpack the archive, create the install directory, and move the contents of the archive tot he directory
    unzip gradle-2.4-all.zip
    sudo mkdir -p /opt/gradle/2.4
    sudo mv gradle-2.4/* /opt/gradle/2.4/
    sudo ln -s /opt/gradle/2.4/ /opt/gradle/current
  5. Now to add the proper PATH, open your bash profile:
    sudo nano ~/.bash_profile
    Add the following entry after the others:
    #### GRADLE 2.7 ###########################
    
        export GRADLE_HOME=/opt/gradle/current
        export PATH=$PATH:$GRADLE_HOME/bin
    
    #### GRADLE 2.7 ###########################
  6. Then run:
    source ~/.bash_profile
  7. Lastly check test the installation and check version:
    gradle -version
Like

Discussions

Monkey wrote 01/13/2016 at 21:56 point

i installed java like in your tutorial, just getting "/usr/java/jdk1.8.0_65/bin/java: No such file or directory" when trying to execute java -version

  Are you sure? yes | no