Skip to content

Commit

Permalink
docs: Updating references for balena
Browse files Browse the repository at this point in the history
Change-type: patch
Signed-off-by: Gareth Davies <[email protected]>
  • Loading branch information
garethtdavies committed Dec 10, 2019
1 parent 885d2ae commit d7002fe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 21 deletions.
4 changes: 1 addition & 3 deletions Dockerfile.template
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
FROM resin/%%RESIN_MACHINE_NAME%%-openjdk:latest
FROM balenalib/%%BALENA_MACHINE_NAME%%-openjdk:latest

WORKDIR /usr/src/app

COPY . .

RUN javac Hello.java

ENV INITSYSTEM=on

CMD ["java", "-cp", ".", "Hello"]
2 changes: 1 addition & 1 deletion Hello.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ public class Hello
{
public static void main(String[] args)
{
System.out.println("Hello Resin");
System.out.println("Hello balena");
}
}
27 changes: 10 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,19 @@

## Introduction

This is a very simple project that is an example of how to run Java code on a [balena](https://balena.io) device.
This is a very simple project that is an example of how to run Java code on a [balena][balena-link] device.

Other Open JDK versions are also supported. You can see them in the [OpenJDK baseimages documentation](https://balena.io/docs/reference/base-images/base-images/#OpenJDK)
Other Open JDK versions are also supported. You can see them in the [OpenJDK baseimages documentation][open-jdk].

### balena Setup & Deployment

1. If you haven't got a [balena](https://balena.io) account, visit [dashboard.balena-cloud.com](https://dashboard.balena-cloud.com/signup) and sign up.
1. Start a new applicaton on [balena](https://balena.io) download the .zip file, format the SD card in FAT32 and extract it to your SD card.
1. Insert the SD card into the device, power it up using the micro-usb cable and connect to the Internet.
1. After about 10 minutes your new device should show up on your application dashboard.
1. You can now clone the Hello.Java repo:
To get this project up and running, you will need to signup for a balena account [here][signup-page] and set up an application and device. You'll find full details in our [Getting Started tutorial][gettingStarted-link].

`$ git clone https://github.com/balena-projects/Hello-Java.git`
Once you have downloaded this project, you can `balena push` it using the [balenaCLI][balena-cli]. This command will package up and push the code to the balena builders, where it will be compiled and built and deployed to every device in the application fleet. When it completes, you'll have your Java code running on your device and see some logs on your [balenaCloud dashboard][balena-dashboard].

Then add the balena remote:

`$ git remote add balena [email protected]:<myUserName>/<myApplicationName>.git`

And finally push the code to your Device:

`$ git push balena master`

Now you can enjoy Java code on [balena](https://balena.io).
[balena-link]:https://balena.io/
[open-jdk]:https://balena.io/docs/reference/base-images/base-images/#OpenJDK
[signup-page]:https://dashboard.balena-cloud.com/signup
[gettingStarted-link]:http://balena.io/docs/learn/getting-started/
[balena-cli]:https://www.balena.io/docs/reference/cli/
[balena-dashboard]:https://dashboard.balena-cloud.com/

0 comments on commit d7002fe

Please sign in to comment.