SlideShare a Scribd company logo
Java on Raspberry Pi Lab
Stephen Chin
Java Technology Ambassador
JavaOne Content Chair
@steveonjava
What Runs Java?
=
Have Java With Your Dessert
Raspberry Pi
Chalkboard Electronics Touchscreen
 10" or 7" Form Factor
 Connects via HDMI/USB
 Tested with JavaFX 8
 10% Exclusive Discount:
G1F0U796Z083
GPIO access
How to Setup Your Pi
> Step 1: Install Linux
> Step 2: Download/Copy Java 8 for ARM EA
> Step 3: Deploy and Run JVM Language Apps
http://steveonjava.com/
javafx-on-raspberry-pi-3-easy-steps/
Electronic Safety!
> Unplug from wall before wiring
> Get rid of static by touching a metal
surface
> Don't touch exposed wires/metal
> Never remove/insert SD Card while
power is on
7
What Comes in Your Lab Kit
1. Touch Screen
2. SD Card
3. Keyboard
4. Yellow Box:
 Power Adapter
 LVDS Cable/Board
 Raspberry Pi Model B
 Mini-USB Cable (power)
 Micro-USB Cable (keyboard)
 Wifi Adapter
Please Save All the Packaging for Later
Hooking Up the Pi (Part A)
1. Insert the SD Card in to the Pi
 Will appear upside down when looking at the top
of your Pi
2. Insert the HDMI board into the Pi's HDMI
jack
3. Connect the Pi power to the HDMI board
 Use the Micro USB Cable (short one)
9
Important: Connect everything before plugging into the wall
Hooking Up the Pi (Part B)
4. Slide the LCD cable into the back of the display
 Side with gold connectors goes up
 Be careful, the connector is fragile!
5. Insert the wifi adapter into one of the USB ports
6. Hook up the USB keyboard
 Use the Mini USB cable (long one)
7. [Optional ] Connect the USB end to one of the Pi's USB host ports
 This provides touch input – will need to unplug wifi or keyboard
10
Verify connections and plug into power now
Is it Working?
> Should get a bunch of flashing LEDs to indicate booting
 Boot takes approx 30 seconds
> The LCD screen should light up
 Might be dim if the light sensor is obstructed
> And you will should see a Linux boot screen with lots of text
Logging In
At the login prompt type your username:
> pi
And enter the password:
> raspberry
Running the JavaFX Sample Application
Change directory to the project folder
> cd MaryHadALittleLambda
Run the build script
> ant
14
Connecting to the Wifi network
> On your computer:
 SSID: NightHacking
 Password: steveonjava
> To get the Pi's ip address
1. Type "ifconfig"
2. Look for the "wlan0" settings
15
Downloading Lab Software
> Start a web browser and navigate to the Pi's IP:
 http://10.0.1.xx (something like this)
> Download and install Java 8 SDK
 Make sure you use this SDK for compiling and testing on the Pi
> Grab an SFTP and SSH client if you need one
 Real hackers use the command line!
Interacting With Your Pi
> Connect via SSH command line or Putty
 ssh pi@10.0.1.xx
 Password: raspberry
> Connect via SFTP command line or GUI Client
 sftp pi@10.0.1.xx
 Password: raspberry
Accept the generated SSH certificate from your Pi
To make an application run
> Build and package your application as a jar
> Copy this to the Raspberry Pi using SFTP
> Execute it via SSH:
> java –jar YourApp.jar
Hacking Time!
Stuff to do…
> Changes to MaryHadALittleLambda:
 Change the number of sheep
 Make the rainbow have different colors
 Change the fox size to be fatter/skinnier
 Add new graphics (additional image files under images/extra)
> Playing with hardware
 Pi4j is in /opt/pi4j
 Check out the sample and try blinking the LED (pin wiring is different)
 Come up and get additional hardware to play with
19
Pi4J Help
> The samples build script is hardcoded to
/opt/pi4j directory. Easiest fix is to rename
the folder to match this.
> Pi4j needs root access to use GPIO (use
"sudo")
> Debian uses secure paths for sudo by
default. Either disable this, or type the full
path to the java executable (easily
discovered using "which java")
20
LED is on GPIO 7
Using the other sensors…
> Read Angela's blog here:
 https://blogs.oracle.com/acaicedo/entry/some_samples_using_gpio_an
d
> Download the source for the…
 Pressure/Temperature sensor:
https://blogs.oracle.com/acaicedo/resource/RPi-HOL/Sensor.java
 Accelerometer/Gyroscope/Compass sensor:
https://blogs.oracle.com/acaicedo/resource/RPi-HOL/Sensor.java
21
Stephen Chin
tweet: @steveonjava
blog: http://steveonjava.com
nighthacking.com
Real Geeks
Live Hacking
NightHacking Tour
Safe Harbor Statement
The preceding is intended to outline our general product
direction. It is intended for information purposes only, and
may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality,
and should not be relied upon in making purchasing
decisions. The development, release, and timing of any
features or functionality described for Oracle’s products
remains at the sole discretion of Oracle.
Ad

Recommended

Devoxx4Kids Lego Workshop
Devoxx4Kids Lego Workshop
Stephen Chin
 
Oracle IoT Kids Workshop
Oracle IoT Kids Workshop
Stephen Chin
 
Raspberry Pi Gaming 4 Kids (Devoxx4Kids)
Raspberry Pi Gaming 4 Kids (Devoxx4Kids)
Stephen Chin
 
JCrete Embedded Java Workshop
JCrete Embedded Java Workshop
Stephen Chin
 
Raspberry pi gaming 4 kids
Raspberry pi gaming 4 kids
Stephen Chin
 
RetroPi Handheld Raspberry Pi Gaming Console
RetroPi Handheld Raspberry Pi Gaming Console
Stephen Chin
 
Raspberry Pi with Java (JJUG)
Raspberry Pi with Java (JJUG)
Stephen Chin
 
Internet of Things Magic Show
Internet of Things Magic Show
Stephen Chin
 
Remote Notifications
Remote Notifications
Josef Cacek
 
Console design 1
Console design 1
bowes96123
 
Console design template
Console design template
LewisB2013
 
5.Playtime
5.Playtime
Mayank Joneja
 
Game programming with Groovy
Game programming with Groovy
James Williams
 
Gamelog
Gamelog
Luke Summers
 
Gamelog
Gamelog
Luke Summers
 
Steam backup-game-files
Steam backup-game-files
ssuser1eca7d
 
Instrucciones
Instrucciones
Duvan Romero
 
IoT: LoRa and Java on the PI
IoT: LoRa and Java on the PI
JWORKS powered by Ordina
 
Java Device I/O at Raspberry PI to Build a Candy Vending Machine
Java Device I/O at Raspberry PI to Build a Candy Vending Machine
Jeff Prestes
 
Hands on Java8 and RaspberryPi
Hands on Java8 and RaspberryPi
Pance Cavkovski
 
How to make your Money Machine with Internet of Things
How to make your Money Machine with Internet of Things
Jeff Prestes
 
Raspberry Pi with Java
Raspberry Pi with Java
koji lin
 
Up and running with Raspberry Pi
Up and running with Raspberry Pi
Shahed Mehbub
 
Raspberry Pi with Java 8
Raspberry Pi with Java 8
javafxpert
 
Raspberry-Pi
Raspberry-Pi
Rehan Fazal
 
Raspberry Pi - Unlocking New Ideas for Your Library
Raspberry Pi - Unlocking New Ideas for Your Library
Brian Pichman
 
Raspberry Pi ppt.pptx
Raspberry Pi ppt.pptx
ushabharathisb1
 
Raspberry Pi ppt.pptx
Raspberry Pi ppt.pptx
ushabharathisb1
 
Raspberry pi: Conceptos básicos de la arquitectura de la computadora raspberr...
Raspberry pi: Conceptos básicos de la arquitectura de la computadora raspberr...
SANTIAGO PABLO ALBERTO
 
Raspberry pi
Raspberry pi
Pravesh Sahu
 

More Related Content

What's hot (9)

Remote Notifications
Remote Notifications
Josef Cacek
 
Console design 1
Console design 1
bowes96123
 
Console design template
Console design template
LewisB2013
 
5.Playtime
5.Playtime
Mayank Joneja
 
Game programming with Groovy
Game programming with Groovy
James Williams
 
Gamelog
Gamelog
Luke Summers
 
Gamelog
Gamelog
Luke Summers
 
Steam backup-game-files
Steam backup-game-files
ssuser1eca7d
 
Instrucciones
Instrucciones
Duvan Romero
 

Similar to Java on Raspberry Pi Lab (20)

IoT: LoRa and Java on the PI
IoT: LoRa and Java on the PI
JWORKS powered by Ordina
 
Java Device I/O at Raspberry PI to Build a Candy Vending Machine
Java Device I/O at Raspberry PI to Build a Candy Vending Machine
Jeff Prestes
 
Hands on Java8 and RaspberryPi
Hands on Java8 and RaspberryPi
Pance Cavkovski
 
How to make your Money Machine with Internet of Things
How to make your Money Machine with Internet of Things
Jeff Prestes
 
Raspberry Pi with Java
Raspberry Pi with Java
koji lin
 
Up and running with Raspberry Pi
Up and running with Raspberry Pi
Shahed Mehbub
 
Raspberry Pi with Java 8
Raspberry Pi with Java 8
javafxpert
 
Raspberry-Pi
Raspberry-Pi
Rehan Fazal
 
Raspberry Pi - Unlocking New Ideas for Your Library
Raspberry Pi - Unlocking New Ideas for Your Library
Brian Pichman
 
Raspberry Pi ppt.pptx
Raspberry Pi ppt.pptx
ushabharathisb1
 
Raspberry Pi ppt.pptx
Raspberry Pi ppt.pptx
ushabharathisb1
 
Raspberry pi: Conceptos básicos de la arquitectura de la computadora raspberr...
Raspberry pi: Conceptos básicos de la arquitectura de la computadora raspberr...
SANTIAGO PABLO ALBERTO
 
Raspberry pi
Raspberry pi
Pravesh Sahu
 
Raspberry pi Board Hardware & Software Setup
Raspberry pi Board Hardware & Software Setup
RANAALIMAJEEDRAJPUT
 
Raspberry Pi Based GPS Tracking System and Face Recognition System.
Raspberry Pi Based GPS Tracking System and Face Recognition System.
Ruthvik Vaila
 
Starting Raspberry Pi
Starting Raspberry Pi
LloydMoore
 
Raspberry Pi - Lecture 6 Working on Raspberry Pi
Raspberry Pi - Lecture 6 Working on Raspberry Pi
Mohamed Abdallah
 
Mocha Raspberry Pi hacking - Stephen Chin
Mocha Raspberry Pi hacking - Stephen Chin
jaxconf
 
Programming the Raspberry Pi element14
Programming the Raspberry Pi element14
Imad Rhali
 
Raspberry pi on java 20121110
Raspberry pi on java 20121110
Masafumi Ohta
 
Java Device I/O at Raspberry PI to Build a Candy Vending Machine
Java Device I/O at Raspberry PI to Build a Candy Vending Machine
Jeff Prestes
 
Hands on Java8 and RaspberryPi
Hands on Java8 and RaspberryPi
Pance Cavkovski
 
How to make your Money Machine with Internet of Things
How to make your Money Machine with Internet of Things
Jeff Prestes
 
Raspberry Pi with Java
Raspberry Pi with Java
koji lin
 
Up and running with Raspberry Pi
Up and running with Raspberry Pi
Shahed Mehbub
 
Raspberry Pi with Java 8
Raspberry Pi with Java 8
javafxpert
 
Raspberry Pi - Unlocking New Ideas for Your Library
Raspberry Pi - Unlocking New Ideas for Your Library
Brian Pichman
 
Raspberry pi: Conceptos básicos de la arquitectura de la computadora raspberr...
Raspberry pi: Conceptos básicos de la arquitectura de la computadora raspberr...
SANTIAGO PABLO ALBERTO
 
Raspberry pi Board Hardware & Software Setup
Raspberry pi Board Hardware & Software Setup
RANAALIMAJEEDRAJPUT
 
Raspberry Pi Based GPS Tracking System and Face Recognition System.
Raspberry Pi Based GPS Tracking System and Face Recognition System.
Ruthvik Vaila
 
Starting Raspberry Pi
Starting Raspberry Pi
LloydMoore
 
Raspberry Pi - Lecture 6 Working on Raspberry Pi
Raspberry Pi - Lecture 6 Working on Raspberry Pi
Mohamed Abdallah
 
Mocha Raspberry Pi hacking - Stephen Chin
Mocha Raspberry Pi hacking - Stephen Chin
jaxconf
 
Programming the Raspberry Pi element14
Programming the Raspberry Pi element14
Imad Rhali
 
Raspberry pi on java 20121110
Raspberry pi on java 20121110
Masafumi Ohta
 
Ad

More from Stephen Chin (20)

DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2
Stephen Chin
 
10 Ways Everyone Can Support the Java Community
10 Ways Everyone Can Support the Java Community
Stephen Chin
 
Java Clients and JavaFX: The Definitive Guide
Java Clients and JavaFX: The Definitive Guide
Stephen Chin
 
DevOps Tools for Java Developers
DevOps Tools for Java Developers
Stephen Chin
 
Java Clients and JavaFX - Presented to LJC
Java Clients and JavaFX - Presented to LJC
Stephen Chin
 
JavaFX on Mobile (by Johan Vos)
JavaFX on Mobile (by Johan Vos)
Stephen Chin
 
Confessions of a Former Agile Methodologist (JFrog Edition)
Confessions of a Former Agile Methodologist (JFrog Edition)
Stephen Chin
 
Confessions of a Former Agile Methodologist
Confessions of a Former Agile Methodologist
Stephen Chin
 
Zombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the Undead
Stephen Chin
 
OpenJFX on Android and Devices
OpenJFX on Android and Devices
Stephen Chin
 
Java 8 for Tablets, Pis, and Legos
Java 8 for Tablets, Pis, and Legos
Stephen Chin
 
DukeScript
DukeScript
Stephen Chin
 
Devoxx4Kids NAO Workshop
Devoxx4Kids NAO Workshop
Stephen Chin
 
Raspberry Pi Gaming 4 Kids - Dutch Version
Raspberry Pi Gaming 4 Kids - Dutch Version
Stephen Chin
 
Mary Had a Little λ (QCon)
Mary Had a Little λ (QCon)
Stephen Chin
 
Raspberry Pi à la GroovyFX
Raspberry Pi à la GroovyFX
Stephen Chin
 
LUGOD Raspberry Pi Hacking
LUGOD Raspberry Pi Hacking
Stephen Chin
 
Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5
Stephen Chin
 
Hacking JavaFX with Groovy, Clojure, Scala, and Visage
Hacking JavaFX with Groovy, Clojure, Scala, and Visage
Stephen Chin
 
JavaFX 2 - A Java Developer's Guide (San Antonio JUG Version)
JavaFX 2 - A Java Developer's Guide (San Antonio JUG Version)
Stephen Chin
 
DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2
Stephen Chin
 
10 Ways Everyone Can Support the Java Community
10 Ways Everyone Can Support the Java Community
Stephen Chin
 
Java Clients and JavaFX: The Definitive Guide
Java Clients and JavaFX: The Definitive Guide
Stephen Chin
 
DevOps Tools for Java Developers
DevOps Tools for Java Developers
Stephen Chin
 
Java Clients and JavaFX - Presented to LJC
Java Clients and JavaFX - Presented to LJC
Stephen Chin
 
JavaFX on Mobile (by Johan Vos)
JavaFX on Mobile (by Johan Vos)
Stephen Chin
 
Confessions of a Former Agile Methodologist (JFrog Edition)
Confessions of a Former Agile Methodologist (JFrog Edition)
Stephen Chin
 
Confessions of a Former Agile Methodologist
Confessions of a Former Agile Methodologist
Stephen Chin
 
Zombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the Undead
Stephen Chin
 
OpenJFX on Android and Devices
OpenJFX on Android and Devices
Stephen Chin
 
Java 8 for Tablets, Pis, and Legos
Java 8 for Tablets, Pis, and Legos
Stephen Chin
 
Devoxx4Kids NAO Workshop
Devoxx4Kids NAO Workshop
Stephen Chin
 
Raspberry Pi Gaming 4 Kids - Dutch Version
Raspberry Pi Gaming 4 Kids - Dutch Version
Stephen Chin
 
Mary Had a Little λ (QCon)
Mary Had a Little λ (QCon)
Stephen Chin
 
Raspberry Pi à la GroovyFX
Raspberry Pi à la GroovyFX
Stephen Chin
 
LUGOD Raspberry Pi Hacking
LUGOD Raspberry Pi Hacking
Stephen Chin
 
Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5
Stephen Chin
 
Hacking JavaFX with Groovy, Clojure, Scala, and Visage
Hacking JavaFX with Groovy, Clojure, Scala, and Visage
Stephen Chin
 
JavaFX 2 - A Java Developer's Guide (San Antonio JUG Version)
JavaFX 2 - A Java Developer's Guide (San Antonio JUG Version)
Stephen Chin
 
Ad

Recently uploaded (20)

OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
 
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
Curietech AI in action - Accelerate MuleSoft development
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Alliance
 
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Alliance
 
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Cluster-Based Multi-Objective Metamorphic Test Case Pair Selection for Deep N...
Cluster-Based Multi-Objective Metamorphic Test Case Pair Selection for Deep N...
janeliewang985
 
The Future of AI Agent Development Trends to Watch.pptx
The Future of AI Agent Development Trends to Watch.pptx
Lisa ward
 
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
Edge AI and Vision Alliance
 
Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
Powering Multi-Page Web Applications Using Flow Apps and FME Data Streaming
Powering Multi-Page Web Applications Using Flow Apps and FME Data Streaming
Safe Software
 
Information Security Response Team Nepal_npCERT_Vice_President_Sudan_Jha.pdf
Information Security Response Team Nepal_npCERT_Vice_President_Sudan_Jha.pdf
ICT Frame Magazine Pvt. Ltd.
 
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
 
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
Curietech AI in action - Accelerate MuleSoft development
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Alliance
 
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Alliance
 
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Cluster-Based Multi-Objective Metamorphic Test Case Pair Selection for Deep N...
Cluster-Based Multi-Objective Metamorphic Test Case Pair Selection for Deep N...
janeliewang985
 
The Future of AI Agent Development Trends to Watch.pptx
The Future of AI Agent Development Trends to Watch.pptx
Lisa ward
 
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
Edge AI and Vision Alliance
 
Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
Powering Multi-Page Web Applications Using Flow Apps and FME Data Streaming
Powering Multi-Page Web Applications Using Flow Apps and FME Data Streaming
Safe Software
 
Information Security Response Team Nepal_npCERT_Vice_President_Sudan_Jha.pdf
Information Security Response Team Nepal_npCERT_Vice_President_Sudan_Jha.pdf
ICT Frame Magazine Pvt. Ltd.
 

Java on Raspberry Pi Lab

  • 1. Java on Raspberry Pi Lab Stephen Chin Java Technology Ambassador JavaOne Content Chair @steveonjava
  • 3. = Have Java With Your Dessert Raspberry Pi
  • 4. Chalkboard Electronics Touchscreen  10" or 7" Form Factor  Connects via HDMI/USB  Tested with JavaFX 8  10% Exclusive Discount: G1F0U796Z083
  • 6. How to Setup Your Pi > Step 1: Install Linux > Step 2: Download/Copy Java 8 for ARM EA > Step 3: Deploy and Run JVM Language Apps http://steveonjava.com/ javafx-on-raspberry-pi-3-easy-steps/
  • 7. Electronic Safety! > Unplug from wall before wiring > Get rid of static by touching a metal surface > Don't touch exposed wires/metal > Never remove/insert SD Card while power is on 7
  • 8. What Comes in Your Lab Kit 1. Touch Screen 2. SD Card 3. Keyboard 4. Yellow Box:  Power Adapter  LVDS Cable/Board  Raspberry Pi Model B  Mini-USB Cable (power)  Micro-USB Cable (keyboard)  Wifi Adapter Please Save All the Packaging for Later
  • 9. Hooking Up the Pi (Part A) 1. Insert the SD Card in to the Pi  Will appear upside down when looking at the top of your Pi 2. Insert the HDMI board into the Pi's HDMI jack 3. Connect the Pi power to the HDMI board  Use the Micro USB Cable (short one) 9 Important: Connect everything before plugging into the wall
  • 10. Hooking Up the Pi (Part B) 4. Slide the LCD cable into the back of the display  Side with gold connectors goes up  Be careful, the connector is fragile! 5. Insert the wifi adapter into one of the USB ports 6. Hook up the USB keyboard  Use the Mini USB cable (long one) 7. [Optional ] Connect the USB end to one of the Pi's USB host ports  This provides touch input – will need to unplug wifi or keyboard 10 Verify connections and plug into power now
  • 11. Is it Working? > Should get a bunch of flashing LEDs to indicate booting  Boot takes approx 30 seconds > The LCD screen should light up  Might be dim if the light sensor is obstructed > And you will should see a Linux boot screen with lots of text
  • 12. Logging In At the login prompt type your username: > pi And enter the password: > raspberry
  • 13. Running the JavaFX Sample Application Change directory to the project folder > cd MaryHadALittleLambda Run the build script > ant
  • 14. 14
  • 15. Connecting to the Wifi network > On your computer:  SSID: NightHacking  Password: steveonjava > To get the Pi's ip address 1. Type "ifconfig" 2. Look for the "wlan0" settings 15
  • 16. Downloading Lab Software > Start a web browser and navigate to the Pi's IP:  http://10.0.1.xx (something like this) > Download and install Java 8 SDK  Make sure you use this SDK for compiling and testing on the Pi > Grab an SFTP and SSH client if you need one  Real hackers use the command line!
  • 17. Interacting With Your Pi > Connect via SSH command line or Putty  ssh [email protected]  Password: raspberry > Connect via SFTP command line or GUI Client  sftp [email protected]  Password: raspberry Accept the generated SSH certificate from your Pi
  • 18. To make an application run > Build and package your application as a jar > Copy this to the Raspberry Pi using SFTP > Execute it via SSH: > java –jar YourApp.jar Hacking Time!
  • 19. Stuff to do… > Changes to MaryHadALittleLambda:  Change the number of sheep  Make the rainbow have different colors  Change the fox size to be fatter/skinnier  Add new graphics (additional image files under images/extra) > Playing with hardware  Pi4j is in /opt/pi4j  Check out the sample and try blinking the LED (pin wiring is different)  Come up and get additional hardware to play with 19
  • 20. Pi4J Help > The samples build script is hardcoded to /opt/pi4j directory. Easiest fix is to rename the folder to match this. > Pi4j needs root access to use GPIO (use "sudo") > Debian uses secure paths for sudo by default. Either disable this, or type the full path to the java executable (easily discovered using "which java") 20 LED is on GPIO 7
  • 21. Using the other sensors… > Read Angela's blog here:  https://blogs.oracle.com/acaicedo/entry/some_samples_using_gpio_an d > Download the source for the…  Pressure/Temperature sensor: https://blogs.oracle.com/acaicedo/resource/RPi-HOL/Sensor.java  Accelerometer/Gyroscope/Compass sensor: https://blogs.oracle.com/acaicedo/resource/RPi-HOL/Sensor.java 21
  • 22. Stephen Chin tweet: @steveonjava blog: http://steveonjava.com nighthacking.com Real Geeks Live Hacking NightHacking Tour
  • 23. Safe Harbor Statement The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.