• Home
    • View
    • Login
    This page
    • Normal
    • Export PDF
    • Page Information

    Loading...
  1. Dashboard
  2. Undefined Space
  3. Device I/O
  4. Getting Started

Getting Started

  • Created by Jen Dority, last modified on Sep 24, 2014

Getting the Source

 

hg clone http://hg.openjdk.java.net/dio/dev

 

Build Instructions

Current Build Platforms

The Device I/O Project currently supports cross-compiling on Linux x86 platforms for the Raspberry Pi (armhf).

Build Tools

gcc-linaro-arm-linux-gnueabihf-raspbian
JDK 8

Build Steps

 

hg clone http://hg.openjdk.java.net/dio/dev
cd dev
export PI_TOOLS=<path to raspberry pi toolchain>
export JAVA_HOME=<path to JDK8>
make

 

The artifacts for the build should be build/so/libdio.so and build/jar/dio.jar.

Running the GPIOLEDSample Application

 

Prerequisites:
1 LED
1 resistor
1 breadboard
1 Raspberry Pi
jumper wires

The dio.jar, dio.samples.jar and libdio.so should be in your current directory, and java should be in your path.

1. Connect the cathode of the LED to GND on the Raspberry Pi.
2. Connect the anode of the LED to a resistor (540 ohm pictured above).
3. Connect the other end of the resistor to GPIO18 on the Raspberry Pi

 

sudo java -Djava.security.policy=./java.policy -classpath .:./dio.jar:dio-samples.jar -Djava.library.path=. -Djdk.dio.registry=./dio.properties dio.gpio.GPIOLEDSample

 

Note the use of "sudo." This is so that the java process has the proper permissions to access the GPIO device.

 

Overview
Content Tools
ThemeBuilder
  • No labels

Terms of Use
• License: GPLv2
• Privacy • Trademarks • Contact Us

Powered by a free Atlassian Confluence Open Source Project License granted to https://www.atlassian.com/software/views/opensource-community-additional-license-offer. Evaluate Confluence today.

  • Kolekti ThemeBuilder Powered by Atlassian Confluence 8.5.21
  • Kolekti ThemeBuilder printed.by.atlassian.confluence
  • Report a bug
  • Atlassian News
Atlassian
Kolekti ThemeBuilder EngineAtlassian Confluence
{"serverDuration": 290, "requestCorrelationId": "a48efe01d26e3bf7"}