Intro to JVM Landscape - raisercostin/software-wiki GitHub Wiki
Java Boundaries
There are different context/scopes in java. Java9 adds module.
- block
- class
- package
- module
- jar
- war/ear/sar/...
- classpath
- maven scopes: compile, runtime, test, optional, provided - https://stackoverflow.com/questions/26975818/what-is-scope-under-dependency-in-pom-xml-for
- test/app
- jvm
References
Advice
- jdk1-jdk7 too old
- xxxJdk8 - is LTS(long term support) but depends on vendor
- OracleJdk8 - no security updates or commercial license
- AdoptOpenJdk8 - $free (libre and gratis) and LTS
- xxxJdk9, xxxJdk10 - don't use it, no LTS deprecated by xxxJdk11
- OracleJdk11 - don't use it, commercial license
- AdoptOpenJdk11 - $free (libre and gratis) and LTS
- OpenJdk11 - $free (libre and gratis) and LTS
References
Short Timeline
For a longer version go to wikipedia - https://en.wikipedia.org/wiki/Java_version_history
jdk1.0
jdk1.2
jdk5
- generics added => much better collectionsjdk6
jdk7
jdk8
- lambda added => much better collections, functional aspectsjdk9
- modules added => much better overall designjdk10
jdk11
- Oracle asks for commercial license => you should switch to OpenJDK (not Oracle OpenJDK)- https://blog.joda.org/2018/09/do-not-fall-into-oracles-java-11-trap.html
- Oracle JDK11 - don't use it
- OpenJDK11 - GPL 2 with the Classpath Exception - https://jdk.java.net/11/ - can be used commercially $free
- others - https://blog.joda.org/2018/09/time-to-look-beyond-oracles-jdk.html
Binaries
- jre & jdk
- openjdk - https://jdk.java.net/ : Java SE openjdk7, openjdk8, openjdk9, openjdk10, openjdk11
- adoptopenjdk - https://adoptopenjdk.net/: adoptOpenJdk8, adoptOpenJdk9, adoptOpenJdk10, adoptOpenJdk11 (in progress at 2018-10-01)
- oracle - never download from oracle.com any jdk anymore (particularly starting with jdk11)
- docker images
- openjdk - https://hub.docker.com/_/openjdk/
- adoptopenjdk - https://hub.docker.com/u/adoptopenjdk/
Implementations
- cloud, containers & microservices comparison
- jdk8
Path vs classpath
Classpath vs path/file
Locatii resurse
- path absolut -
/.....
- nu controlezi mediul
- path relativ
- nu controlezi packagingul final: local, multijar classpath, single jar claspath, docker, ....
- classpath
- este fix, decis la compile time
- path absolut definit de environment variables
- PRO - content can be dynamically changed
- CONS - must be provided