hello, world in Vanilla Java-EHW2018 "MVP"

Overview

This entry is for 12/3 of "Enterprise" hello, world "2018 Advent Calendar 2018". In this Advent Calendar, we plan to cover one topic with one entry as much as possible, considering the flow of the story that spans multiple entries.

The topics mentioned in this entry are "Determine specifications" and "Let's make an MVP (Minimum Viable Product)".

Premise

Please refer to the Enterprise hello, world 2018 site for refusal of the entire Advent Calendar.

Assumed reader

The following situations are assumed as "Enterprise" hello, world "2018" material.

On Day 1, I got a feel for the old program that I had to migrate, so I have to work towards the transition. In order to realize it, we are determined to work according to the premise of EHW2018.

specification

--Display the string "hello, world" in the user interface

That is all. Let's implement it.

Make an MVP

Write first.

Premise

Use OpenJDK 11.0.1. I will send it with Windows10 version 1803.

>C:\Java\jdk-11.0.1\bin\java -version
openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)

write!

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("hello, world");
    }
}

Execute immediately (JEP 330)

In Java11 it was possible to execute ".java" files directly. Wow.

>C:\Java\jdk-11.0.1\bin\java HelloWorld.java
hello, world

Compile and run (JEP 304)

Compile and run. Let's run it with the experimental function from JDK11, "Run without GC (Epsilon GC)".

>C:\Java\jdk-11.0.1\bin\java -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xlog:gc  HelloWorld
[0.028s][info][gc] Resizeable heap; starting at 250M, max: 4011M, step: 128M
[0.030s][info][gc] Using TLAB allocation; max: 4096K
[0.033s][info][gc] Elastic TLABs enabled; elasticity: 1.10x
[0.035s][info][gc] Elastic TLABs decay enabled; decay time: 1000ms
[0.036s][info][gc] Using Epsilon
hello, world
[0.325s][info][gc] Total allocated: 881 KB
[0.325s][info][gc] Average allocation rate: 1391734 KB/sec

Running without GC is interesting in terms of trying the challenge path towards performance (eg Log4j's trial without garbage).

Summary

In this entry, as the third day of "Enterprise" hello, world "2018 Advent Calendar 2018" (EHW2018), I took up the topic of writing hello, world using Java 11 features as much as possible.

As for the story of EHW2018, it is expected that tomorrow around the infrastructure will head for the future.

Recommended Posts

hello, world in Vanilla Java-EHW2018 "MVP"
"Hello World" in Java
Hello world in node.js
Hello World in Java
Spring Boot Hello World in Eclipse
Hello World in java in eclipse now
Hello world in Java and Gradle
Hello, World! In the bootstrap loader area
[Practice! ] Display Hello World in Spring Boot
"Hello, World!" With Kotlin + CLI in 5 minutes
Java, Hello, world!
Java Hello World
Output Hello World in kotlin's simple main function
Hello World with JavaFX 11 (OpenJFX) in Liberica JDK 11
Display "Hello World" in the browser using Java
Display "Hello World" in the browser using Java
Java Learning (1)-Hello World
Studying Java-Part 1-Hello World
Hello World on WebAssembly
Hello World with Micronaut
Hello World with Spring Boot
Java history in this world
Hello World with Spring Boot!
Hello World with VS Code!
java hello world, compile, run
Hello World with Spring Boot
Java beginners read Hello World
Hello World with SpringBoot / Gradle
Hello, World! With Asakusa Framework!
Compare Hello, world! In Spring Boot with Java, Kotlin and Groovy