How Java 15 taught me to love virtual hands-on labs

October 7, 2020 | 6 minute read
Text Size 100%:

I worked through the three live hands-on labs that came with the latest Java release. You can, too.

Download a PDF of this article.

The best way to experience new technology is with a test drive—and in today’s strange new world, that test drive means a virtual hands-on lab (HOL).

For example, at the Oracle Developer Live—Java virtual event held September 15, 2020, there were many presentations about Java 15’s new architectures for data- and compute-intensive workloads. After the presentations, everyone could try out these features for themselves via a self-guided lab, often on the very day the new JDK was made generally available. So that’s exactly what I did.

Fun with Kubernetes

I was fresh off my certification as an Oracle Cloud Infrastructure Foundations 2020 Associate. Having prepared for that test, I already had an Oracle Free Tier Account, and I was very familiar with the Oracle Cloud Infrastructure (OCI) console.

My self-guided lab for the day was “Building Java cloud native applications with Micronaut and Oracle Cloud Infrastructure,” which was led by Oracle’s Monica Riccelli and Maciej Gruszka. The objective was learning the valuable skill of using Kubernetes (in this case, via Oracle Container Engine for Kubernetes) to deploy Oracle WebLogic containers.

Right away, it was evident how easy the process is: Scroll down the left menu bar to Developer Services and choose Kubernetes Clusters, and then click Quick Create to create a new cluster and its attendant network resources (virtual cloud network, internet and NAT gateways, worker nodes, node pool, and load balancers). After about seven minutes, I had a big green hexagon on my cloud console showing an active cluster (see Figure 1).

The big green hexagon shows an active Kubernetes cluster

Figure 1. The big green hexagon shows an active Kubernetes cluster.

The tutorial went on to cover cloning the Oracle WebLogic Server Kubernetes Operator from GitHub and then installing it using Helm. Based on what I’ve seen by attending KubeCon, having even a passing familiarity with these clustering tools makes developers highly desirable to employers.

I didn’t stick around to deploy the Oracle WebLogic domain, scale the cluster, do a rolling restart of a new image, or simulate a cluster across two data centers—all of which are concepts that intrigue many developers who are running applications on Oracle WebLogic Server.

“The majority of these developers are looking right now to find a way to modernize,” says Gruszka, director of product management for Oracle WebLogic. “Containers seem to be the most popular alternative for many of them. Moving to containers opens a path potentially to move to the cloud with a neutral approach. It is technology that opens you up without locking you in to a particular vendor.”

Meanwhile, I was off to my next hands-on lab.

Testing Java 15 in the cloud

At Oracle conferences, I’ve attended a number of in-person talks by David Delabassée, a Java developer relations veteran, including last year in Berlin. His lab showing Java 15’s new features all running on Oracle Cloud Infrastructure was a romp—though afterwards, Delabassée told me that creating the virtual experience for the “Using OCI to build a Java application” lab was a challenge.

Once again, I spawned an OCI environment with a virtual cloud network set to allow internet requests to reach my Java apps. With the security rules properly configured, I then provisioned a compute instance where I would be able to test the new Java features, and I jotted down the public IP address of the instance so I’d be able to reach it from the shell program on my laptop.

I opened up the Terminal app on my Mac, and despite not knowing any Linux commands, I was able to copy and paste each step of the tutorial. As rudimentary as all this may sound, the presenter can’t assume that the participants will follow the path correctly, Delabassée told me the next day.

“I have done many in-person hands-on labs for the last 15 years, so I know that attendees can be creative in interpreting the lab guide,” says Delabassée, who tries not to assume that anything is too obvious.

Now that I had a virtual machine running Linux on OCI, it was time to install the latest version of OpenJDK along with Maven, Git, and Helidon. That sounds like a lot, but Delabassée had written a script, which scrolled madly down my screen for 90 seconds and took care of all that. Then, checking my console, I could see that I indeed had Java 15 installed on my OCI instance (see Figure 2).

The big green hexagon shows an active Kubernetes cluster

Figure 2. Delabassée’s script took care of installing Java 15 on Oracle Cloud Infrastructure.

From there, I was able to complete two more of the 11 labs Delabassée had created: exposing a REST API via the Helidon microservices framework and enabling records, a Java language feature going through a second preview round in Java 15 (see Figure 3).

Enabling preview features via a compiler flag enables experiments with Java records

Figure 3. Enabling preview features via a compiler flag enables experiments with Java records

How Micronaut stacks up

Feeling superhuman, I moved on to my last lab of the day, “Building Java cloud native applications with Micronaut and Oracle Cloud Infrastructure,” which was led by Graeme Rocher, creator of the Micronaut framework and now an architect with Oracle Labs.

This was my most challenging lab yet, and once again I was able to gain plenty of insights by merely working through the first few steps. To start the lab, I needed to create a cloud stack. I downloaded a Terraform configuration file (a recipe for setting up an Oracle Cloud virtual machine and an Oracle Autonomous Database instance), and I was able to choose Stacks in the Resource Manager and drag in that Terraform file. However, I was worried; everything had gone so well with Java, and I wanted to get back to it. Would this Terraform recipe mess all that up?

Just then, I was invited to a breakout room by Todd Sharp, one of several engineers helping to run the lab. Exactly as if we were face to face, he welcomed me to a virtual room with a handful of others working through the tutorial, and we bantered a bit before I asked him if running the Terraform script would mess up my Java 15 labs. He assured me that everything would go fine—it turns out he had written the scripts himself—so I went back to work.

Subsequent steps had me cloning the Micronaut application from GitHub and connecting it to Oracle Autonomous Database. However, it turned out that this is all advanced programming, and I was in “way over my head.”

“Hands-on labs are extremely challenging to design from a user experience and content perspective, especially when they are 100% virtual,” says Chris Bensen, who, along with Sharp, Rocher, and Eric Sedlar, technical director of Oracle Labs, created the entire experience.

“The lab must involve amazing technology, like Micronaut, Helidon, and GraalVM, and be easy for developers to follow along—so it requires an experienced group of engineers to test and staff the event,” says Bensen, adding, “The thousands of hours are worth it when hundreds of attendees show up to learn what we put together.”

Conclusion

Perhaps you are inspired, like me, to get that rush of adrenaline when you see your code running in a distant data center and feel like a puppet master of the internet. Go for it: These hands-on labs are all available, as is the always-free Oracle Cloud Free Tier, right here.

Dig deeper

Alexa Morales

Alexa Weber Morales is director of developer content at Oracle. Morales is the former editor in chief of Software Development magazine and has more than 15 years of experience as a technology content strategist and journalist.


Previous Post

Behind the scenes: How do lambda expressions really work in Java?

Ben Evans | 10 min read

Next Post


Hello, Coherence Community Edition, Part 2: Building the client

Aleks Seović | 28 min read