Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
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 ...
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 Langua...
Electronic Safety!
> Unplug from wall before wiring
> Get rid of static by touching a metal
surface
> Don't touch exposed ...
What Comes in Your Lab Kit
1. Touch Screen
2. SD Card
3. Keyboard
4. Yellow Box:
 Power Adapter
 LVDS Cable/Board
 Rasp...
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...
Hooking Up the Pi (Part B)
4. Slide the LCD cable into the back of the display
 Side with gold connectors goes up
 Be ca...
Is it Working?
> Should get a bunch of flashing LEDs to indicate booting
 Boot takes approx 30 seconds
> The LCD screen s...
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 scrip...
14
Connecting to the Wifi network
> On your computer:
 SSID: NightHacking
 Password: steveonjava
> To get the Pi's ip addre...
Downloading Lab Software
> Start a web browser and navigate to the Pi's IP:
 http://10.0.1.xx (something like this)
> Dow...
Interacting With Your Pi
> Connect via SSH command line or Putty
 ssh pi@10.0.1.xx
 Password: raspberry
> Connect via SF...
To make an application run
> Build and package your application as a jar
> Copy this to the Raspberry Pi using SFTP
> Exec...
Stuff to do…
> Changes to MaryHadALittleLambda:
 Change the number of sheep
 Make the rainbow have different colors
 Ch...
Pi4J Help
> The samples build script is hardcoded to
/opt/pi4j directory. Easiest fix is to rename
the folder to match thi...
Using the other sensors…
> Read Angela's blog here:
 https://blogs.oracle.com/acaicedo/entry/some_samples_using_gpio_an
d...
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 p...
Upcoming SlideShare
Loading in …5
×

Java on Raspberry Pi Lab

3,023 views

Published on

Lab showing demonstrating how to use Java on the Raspberry Pi.

Published in: Technology
  • DOWNLOAD THE BOOK INTO AVAILABLE FORMAT (New Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THE can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THE is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBOOK .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookBOOK, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, EBOOK, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THE Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THE the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THE Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THE BOOK INTO AVAILABLE FORMAT (New Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THE can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THE is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBOOK .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookBOOK, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, EBOOK, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THE Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THE the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THE Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Java on Raspberry Pi Lab

  1. 1. Java on Raspberry Pi Lab Stephen Chin Java Technology Ambassador JavaOne Content Chair @steveonjava
  2. 2. What Runs Java?
  3. 3. = Have Java With Your Dessert Raspberry Pi
  4. 4. Chalkboard Electronics Touchscreen  10" or 7" Form Factor  Connects via HDMI/USB  Tested with JavaFX 8  10% Exclusive Discount: G1F0U796Z083
  5. 5. GPIO access
  6. 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. 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. 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. 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. 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. 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. 12. Logging In At the login prompt type your username: > pi And enter the password: > raspberry
  13. 13. Running the JavaFX Sample Application Change directory to the project folder > cd MaryHadALittleLambda Run the build script > ant
  14. 14. 14
  15. 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. 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. 17. 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
  18. 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. 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. 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. 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. 22. Stephen Chin tweet: @steveonjava blog: http://steveonjava.com nighthacking.com Real Geeks Live Hacking NightHacking Tour
  23. 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.

×