Install Java on BBB - another issue

39 views
Skip to first unread message

Pavel Yermolenko

unread,
Sep 4, 2020, 8:58:57 AM9/4/20
to BeagleBoard
Hello,

According to the book Exploring BeagleBone (Derek Molloy), the instructions to install java on BBB are as follows:

debian@beaglebone:~$ sudo update-alternatives --install /usr/bin/java java /opt/java-jdk/jdk1.8.0_261/bin/java 1
debian@beaglebone:~$ sudo update-alternatives --install /usr/bin/javac javac /opt/java-jdk/jdk1.8.0_261/bin/javac 1


Unless there was a typo, these commands don't work: java has not been installed.

Thanks.

P.S. downloaded archive is unarchived in /opt/java-jdk

Robert Nelson

unread,
Sep 4, 2020, 9:42:26 AM9/4/20
to Beagle Board
On Fri, Sep 4, 2020 at 7:59 AM Pavel Yermolenko <py.o...@sunrise.ch> wrote:
>
> Hello,
>
> According to the book Exploring BeagleBone (Derek Molloy), the instructions to install java on BBB are as follows:

Revision 1 or Revision 2 of the book?

>
> debian@beaglebone:~$ sudo update-alternatives --install /usr/bin/java java /opt/java-jdk/jdk1.8.0_261/bin/java 1
> debian@beaglebone:~$ sudo update-alternatives --install /usr/bin/javac javac /opt/java-jdk/jdk1.8.0_261/bin/javac 1
>
> Unless there was a typo, these commands don't work: java has not been installed.
>
> Thanks.
>
> P.S. downloaded archive is unarchived in /opt/java-jdk

sudo apt install java-common ?

Ignoring "java 8", as that pre-dates Oracle merging their arm-32
branch directly into open-jdk.. So after java-8, openjdk is Oracle's
java..

So unless you absolutely need Java 8, just look at openjdk..

Regards,

--
Robert Nelson
https://rcn-ee.com/

Pavel Yermolenko

unread,
Sep 4, 2020, 9:51:38 AM9/4/20
to BeagleBoard
Revision 1 or Revision 2 of the book?
2nd

sudo apt install java-common
Works ! Thanks.
BTW it installs "openjdk" ?

On Friday, September 4, 2020 at 3:42:26 PM UTC+2, RobertCNelson wrote:

Robert Nelson

unread,
Sep 4, 2020, 9:58:31 AM9/4/20
to Beagle Board
On Fri, Sep 4, 2020 at 8:51 AM Pavel Yermolenko <py.o...@sunrise.ch> wrote:
>
> Revision 1 or Revision 2 of the book?
> 2nd

and as i asked that, i remembered, that book is sitting at work an hour away..

>
> sudo apt install java-common
> Works ! Thanks.
> BTW it installs "openjdk" ?

OpenJDK (Open Java Development Kit)

Oracle submitted their Java 9 port for arm to OpenJDK:

https://openjdk.java.net/jeps/297

Pavel Yermolenko

unread,
Sep 4, 2020, 10:08:59 AM9/4/20
to BeagleBoard
OpenJDK (Open Java Development Kit)
With java-common I can run java files, so probably I'll not need OpenJDK

... that book is sitting at work an hour away..
Sorry, here I didn't understand what you mean.

On Friday, September 4, 2020 at 3:58:31 PM UTC+2, RobertCNelson wrote:

Robert Nelson

unread,
Sep 4, 2020, 10:18:32 AM9/4/20
to Beagle Board
On Fri, Sep 4, 2020 at 9:09 AM Pavel Yermolenko <py.o...@sunrise.ch> wrote:
>
> OpenJDK (Open Java Development Kit)
> With java-common I can run java files, so probably I'll not need OpenJDK

OpenJDK provides /usr/bin/java

Pavel Yermolenko

unread,
Sep 4, 2020, 10:28:07 AM9/4/20
to BeagleBoard
Well ... after executing instructions from "Exploring BeagleBone" and then installing java-common, java seems well installed:
debian@beaglebone:~$ ls /usr/bin/java* -l
lrwxrwxrwx 1 root root 22 Sep  4 12:46 /usr/bin/java -> /etc/alternatives/java
lrwxrwxrwx 1 root root 23 Sep  4 12:48 /usr/bin/javac -> /etc/alternatives/javac
debian@beaglebone:~$ java -version
java version "1.8.0_261"
Java(TM) SE Runtime Environment (build 1.8.0_261-b13)
Java HotSpot(TM) Client VM (build 25.261-b13, mixed mode)
debian@beaglebone:~$


On Friday, September 4, 2020 at 4:18:32 PM UTC+2, RobertCNelson wrote:

Robert Nelson

unread,
Sep 4, 2020, 10:32:41 AM9/4/20
to Beagle Board
On Fri, Sep 4, 2020 at 9:28 AM Pavel Yermolenko <py.o...@sunrise.ch> wrote:
>
> Well ... after executing instructions from "Exploring BeagleBone" and then installing java-common, java seems well installed:
> debian@beaglebone:~$ ls /usr/bin/java* -l
> lrwxrwxrwx 1 root root 22 Sep 4 12:46 /usr/bin/java -> /etc/alternatives/java
> lrwxrwxrwx 1 root root 23 Sep 4 12:48 /usr/bin/javac -> /etc/alternatives/javac
> debian@beaglebone:~$ java -version
> java version "1.8.0_261"
> Java(TM) SE Runtime Environment (build 1.8.0_261-b13)
> Java HotSpot(TM) Client VM (build 25.261-b13, mixed mode)
> debian@beaglebone:~$

I "think" update-alternatives just needs /usr/bin/java to exist, which
was solved by java-common..

Then it just updated the symlink when you ran it..

Pavel Yermolenko

unread,
Sep 4, 2020, 10:37:41 AM9/4/20
to BeagleBoard
Probably.
Thanks.

On Friday, September 4, 2020 at 4:32:41 PM UTC+2, RobertCNelson wrote:
Reply all
Reply to author
Forward
0 new messages