Notes from Raspberry Pi with Java 9 session – CON6210 – JavaOne 2016

A few interesting notes from the Java 9 Embedded on Raspberry Pi, session CON6210, presented by Stephen Chin.

Currently streaming live on YouTube: https://www.youtube.com/watch?v=v95y5CzvcZ4&feature=youtu.be

Full live stream schedule is here: https://community.oracle.com/docs/DOC-1005786

  • SE9 Embedded will be available in a ARM build for the Raspberry Pi
  • This ARM specific build will only be available for Pi 2 and 3 (not the original Pi 1 A/B and + models, as it’s been compiled for ARM Thumb-2 instructions, and these are only supported on Pi 2 ARM CPU and above
  • AWT, Swing and JavaFX will all be supported on SE9 Embedded on the Pi
  • Interesting side note about modular Jigsaw in SE9 – apparently the module file packaging and compression is moving away from zip based Jars, to another format that’s more efficient for class lookup/retrieval

Learning by doing

I’m often asked ‘how do I learn [insert something new here]?’, or ‘what approach do you use for learning something new?’. You can learn many ways, we all have different styles of learning so you should experiment to find out what works for you

In software development, learning by doing should never be ignored as a useful technique. It’s one thing to learn something at a high level by listening to a podcast, reading something online or in a book, but the next step if you really want to learn the ins and outs is to do it yourself.

Here’s an example of why this approach is valuable. You overhear a guy talking about how a machine is turned on: ‘to turn on the machine you press this button’. Some time later someone else asks you how to turn on the machines, and remembering the conversation earlier, ‘you press this button here’ – the other guy presses it, and nothing happens. Huh, what went wrong?

If you’d tried to turn on the machine yourself earlier you would have found out, probably by trial and error, that there’s a key and it needs to be turned to the ‘on’ position before you press the button. There’s no way you would have learned this just by the earlier conversation, but if you’d tried to turn on the machine yourself, if the key was in the ‘off’ position then the button wouldn’t have worked and so you would have started to investigate further, get the manual, or go and find the other guy and ask some questions.

This is rather contrived example to make a point, and how much detail you need or want to know about any given topic of course varies. However, in software development, I don’t think anyone would argue that you don’t learn to program by reading a book; you learn by doing, you learn by writing code. Go write some code, you might learn something.

Enabling Ubuntu Bash shell on Windows 10 with the Anniversary update

I already have the Anniversary Update on my Windows 10 install, and I needed to ssh into one of my Raspberry Pis. I normally do this from my Mac, but since I’m in Windows 10 working on something, I thought this would be a great opportunity to install the new Ubuntu Bash support and then I can ssh from there right? (I could just install Putty, but then I wouldn’t have a reason to check out the Ubuntu Bash support, right?)

First attempt following instructions here, the bash windows opened and closed quick, too quick to read whether there was an error or not.

Second attempt, from a Command Prompt, entering bash, I got this:

Ok, to enable Developer Mode, into Settings, and click the radio button under ‘Use Developer Features’:

Then I got this error:

Hmm. Not very helpful. Clicking on Learn More opened a browser to a help page, but it didn’t load – I’d reconfigured my ip address to a static address on a local network for testing, and I didn’t have internet access. 0x80004005 probably could be a little more helpful, but enabling DHCP to get an internet connection and then tried selecting the Developer Mode option again, it downloaded, said ‘Some features may not be available until your PC is rebooted’. Rebooted, ran bash from Command Prompt, and now it prompted to download the Ubuntu Bash support. Why it couldn’t have done this already is beyond me, and I’ve already rebooted once, but answering ‘y’ it starts downloading:

After it completes you create a unix user and then you’re all set, and it even has ssh included.