Skip to content

IvoNet/java-magazine-javaupgrade-article-companion-code

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

Migrate Java 1.8 to 11+

This is a repo with some examples used in the Java Magazine article I wrote for Q1 2020.

It was set up as a Maven project but I tested the stuff with different docker containers with different java versions.

Prerequisites

How to use

if you want to see the differences that happen when compiling with java 1.8 or e.g. java 9 or 11 the follow the instructions below.

git clone

Java 1.8

  • Open a terminal and go to this repo
docker run --rm -it --name j8 -v "$(pwd):/project" ivonet/openjdk:8 /bin/bash
  • on docker container prompt:
cd /project/src/main/java
javac nl/ivonet/CLASS_YOU_WANT_TO_COMPILE_HERE.java
java java nl.ivonet.CLASS_YOU_WANT_TO_COMPILE_HERE 

Java 9

  • Open a terminal and go to this repo
docker run --rm -it --name j9 -v "$(pwd):/project" ivonet/openjdk:9 /bin/bash
  • on docker container prompt:
cd /project/src/main/java
javac nl/ivonet/CLASS_YOU_WANT_TO_COMPILE_HERE.java
java java nl.ivonet.CLASS_YOU_WANT_TO_COMPILE_HERE # This will only work if the compile worked :-)

Java 11

  • Open a terminal and go to this repo
docker run --rm -it --name j11 -v "$(pwd):/project" ivonet/openjdk:11 /bin/bash
  • on docker container prompt:
cd /project/src/main/java
javac nl/ivonet/CLASS_YOU_WANT_TO_COMPILE_HERE.java
java java nl.ivonet.CLASS_YOU_WANT_TO_COMPILE_HERE # This will only work if the compile worked :-)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages