Java

From Braindump
Jump to navigation Jump to search

Java Versions

Invented in the '90-ies by SUN Microsystems, intended for interactive television. SUN Microsystems acquired by Oracle, license for large enterprises are now charged per virtual machine or for each virtual core supporting the JVM. This applies to Oracle Java and not to the reference implementation OpenJDK, which is open and free to use following the opensource license.

JRE tools including standard libraries and runtime JVM virtual machine

JDK compiles into JAVA bytecode.

Java versions are weird, Java2 had versions 1 to 8, where 8 is the last version received vulnerability fixes.

Then LTS versions are 11, 17, 21, 25 ... bytecode follows internal numbering is like 68. Version sensitive, has to be within range. That makes JAVA difficult to update. Code may not always be forward compatible.

SE Standard Edition

EE Enterprise Editions, adds tools and classes

ME Micro Edition / JAVA Applets were discontinued SUN Microsystems acquired by Oracle, license for large companies are now charged per virtual machine.

Alternatives

OpenJDK builds: Microsoft, IBM, Redhat, SAP, Azul, etc

https://docs.microsoft.com/en-us/java/openjdk/download

Eclipse Adoptium, Temurin-11.0.15+10" JAVA_VERSION="11.0.15" JAVA_VERSION_DATE="2022-04-19"

Structure

.java is the source code, needs to have the same name as the class it defines and in the directory mentioned in the package

.class compile java class, this can be run in the runtime.

.jar is a zip file with classes JAVA_HOME

JAVA_HOME

JRE_HOME

JDK_HOME

Derive Languages

Kotlin, Scala, Groovy, Ruby

Build tools

ANT

Maven

Gradle

object oriented class

/com/janmg/hello.java
package com.janmg
static void main(args)
{
   System.out.println("Hello World");
}
javac -cp / /com/janmg/hello.java
java -cp . hello

Maven

LOG4J