Thursday, December 17, 2020

Switching Java versions by command in Ubuntu

At first install multiple versions of Java. 

$ sudo apt update
$ sudo apt install openjdk-8-jdk
$ sudo apt install openjdk-11-jdk

Then you can switch java versions as follows:

$ update-java-alternatives --list
java-1.11.0-openjdk-amd64      1111       /usr/lib/jvm/java-1.11.0-openjdk-amd64
java-1.8.0-openjdk-amd64       1081       /usr/lib/jvm/java-1.8.0-openjdk-amd64
$ sudo update-java-alternatives --set /usr/lib/jvm/java-1.11.0-openjdk-amd64
$ javac -version
javac 11.0.9.1
$ java -version
openjdk version "11.0.9.1" 2020-11-04

If you set JAVA_HOME, maybe you have to change this too.

Wednesday, December 9, 2020

Springboot + MPA + webpack

 

MPA

Webpack is usually used for Single page application recently. You can find many articles on how to set up webpack for SPA. But, in my case, I had to use webpack for Multi Page Application (MPA).

It was a bit difficult to use Webpack for MPA Spring boot, so I want to share how I did it.

How I used webpack for spring boot MPA

You can see how I used webpack for spring boot MPA from here: https://github.com/lechatthecat/vanilla-javascript-boilerplate-spring-boot