-
Notifications
You must be signed in to change notification settings - Fork 2
Java
Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA), meaning that compiled Java code can run on all platforms that support Java without the need for recompilation. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of computer architecture.
Java was originally developed by James Gosling at Sun Microsystems (which has since been acquired by Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from [C and C++], but it has fewer low-level facilities than either of them.
As of 2016, Java is one of the most popular programming languages in use, particularly for client-server web applications, with a reported 9 million developers, although there's been an effort to push away from using Java and Flash applications in web browsers for [HTML5].
Java and JavaScript are two different languages and are NOT interchangable!
The Free Software Foundation would rather you install OpenJDK and IcedTea because of the whole GNU thing. However, nothing beats the real thing when it comes to installing Java. And the Java Team at Oracle (many of whom used to work at Sun) has been more than cool with using Java on Raspberry Pi. The best part, it is full Java. Not the crappy version of Java, Java ME, that was made for mobile devices back in the 2000s (although the original Motorola RAZR still has a place in my heart).
Java has a version of Java 8 for ARM architecture. Built for Raspberry Pi, this version of Java also works for Odroid!
CAUTION These instructions may be out of date. They are still good for something though.
- Start by going here: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
- Accept Oracle's Binary Code License Agreement.
- Download Java SE Development Kit 8 Update 73 for Linux ARM v6/v7 Hard Float ABI, the file I downloaded was called
jdk-8u73-linux-arm32-vfp-hflt.tar.gzwhich I downloaded to the directory~/Software. -
tar -xzvf jdk-8u73-linux-arm32-vfp-hflt.tar.gz. By extracting it in the~/Softwaredirectory, we don't need to change the permission for us to use. -
sudo mv jdk1.8.0_73/ /opt/. Move it to the/opt/directory. - Set default java and javac to the new installed jdk8.
```
$ sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_73/bin/javac 1
$ sudo update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_73/bin/java 1
$ sudo update-alternatives --config javac # Select 1
$ sudo update-alternatives --config java # Select 1
```
- We verify with the commands with -verion option.
```
javac -version
java -version
```
- Finally, we set our
$JAVA_HOMEvariable and add Java to our$PATHvariable. This is necessary because some Java basedapplications require a$JAVA_HOMEvariable. We will need to set this system-wide so we will need to create/etc/profile.d/jdk.sh. You will need to use vim ornanoto create this file as trying to do it thesudo bash -c "echo 'something'"way doesn't work so well with variables.
```
export JAVA_HOME=/opt/jdk1.8.0_73
export PATH=$JAVA_HOME/bin:$PATH
```
- Start a new terminal. You should see
$JAVA_HOME/binas part of$PATHand have$JAVA_HOMEecho the path of Java now. - Reboot. You need to do this to make sure root know about the new variables or else things like Ant and Maven won't install when we try to install JRuby.
TODO: Create a java file to test.
TODO: Show instructions for compiling and executing.
Setup
- [Assemble the Hardware](Assemble the Hardware)
- [Install the Software](Install the Software)
- SD Card Formatting and Image Mounting
- ❤️ [TLDR version](Install the Software#tldr)
- 🆕 [Windows version](Install the Software#doing-this-in-windows)
- 🆙 [Setup your Raspberry Pi](Setup your Raspberry Pi)
- [Download the Missing Parts](Download the Missing Parts)
- Clone this repo
- 🆕 [Install these first](Install these first)
-
Python(It's taken care of) - 🆙 CMake
- 🆙 Node
- 🆕 Expect (Tcl/Tk is not dead!)
- 🆙 tmux and ncurses
- 🆙 htop
- 🆙 wavemon
- Vim
- 🆙 Ruby
- 🆙 weechat
- 🆕 urxvt 256 color terminal!
- 🆕 i3 A better window manager
- 🆕 Ranger
- 🆙 Qt5
- 🆕 Chromium
wicd-curses- 📻 Software Defined Radio
- 🎮 [Linux Toys](Linux Toys)
Typical Utilities
- [Downloading and extracting with curl and tar](curl and tar)
- [Browsing with ls and cat](ls and cat)
- [Searching with grep and find](grep and find)
- [Filtering with sed and awk](sed and awk)
- [Piping with less, pv, and tee](less, pv, and tee)
- Monitor your system with htop
- Multiplex with tmux