Despite strong competitors like JavaScript, Python, C#, C++… Billions of server computers, desktop computers, devices (meters, TVs, smarphones, blu-ray players…) and smart cards use Java as core programming language. Java evolved with key versions: Java (1995), Java 2 (
java.beans
…), Java 5 (enumerated types, generics…), Java 6, 7, 8 (streams…), 9 (modules…) 10, 11…Java positioning in programming languages competition
First rose Pascal, CoBOL, ForTran, BASIC (Beginner's All-purpose Symbolic Instruction Code)… and later on… C, C++, Java, JavaScript, Python… The way languages popularity is nowadays measured depends upon data extracted from the Web. For example, the TIOBE Index proposes a ranking of languages.
Ranking in 2024
Most wanted…
Energy efficiency ☛
Styles of programming
Rule(s)
- Styles of programming pervade IT domains: business, embedded systems and infrastructures, pedagogy, science, Web… based on several programming paradigms:
- Imperative… versus declarative
- From event-based to asynchronous
- Functional (from LisP to lambda expressions)
- Logical (from Prolog to Drools)
- Object… versus structured… versus unstructured (from Simula 67 to AssemblyScript, Grain, Zig…)
- From parallel to concurrent
- Web (from network programming to the Internet of Things -IoT-)
- Any other style?
Core and extended features of Java depend upon a Java Virtual Machine -JVM- version. For example, “streams” are supported from Java ver. 8. Picture shows JVM 8 that embeds a lot of technologies like SQL, XML, Web… whose functional interest in a specific app. is debatable.
Starting from Java 9 and next releases (Java 10, 11…), new syntax is introduced (e.g.,
module
orvar
) while APIs evolve and/or disappear from the kernel of lastest JVM version. This creates inter-release compatibility disruption. With respect to this trend, Java 11 is recognized as a key step to migrate from Java 8 (see also ☛ or ☛).Novelties are commented on several Web sites, say, Java 10, Java 11, etc.
Java 8 52 Java 9 53 Java 10 54 Java 11 55
macOS
Current shellJava Virtual Machine -JVM- location commandecho $0
Display (example)/usr/libexec/java_home -V
Active JVM (empty ⇒ very last version is chosen)Matching Java Virtual Machines (3): 18.0.1.1 (x86_64) "Oracle Corporation" - "Java SE 18.0.1.1" /Library/Java/JavaVirtualMachines/jdk-18.0.1.1.jdk/Contents/Home 1.8.333.02 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home 1.8.0_333 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_333.jdk/Contents/Home /Library/Java/JavaVirtualMachines/jdk-18.0.1.1.jdk/Contents/Home
Changing default JDK version (current session)echo $JAVA_HOME
Active JVM (note that Java 8 does not supportexport JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_333`
--version
)Java compilerjava -version
Java packagerjavac -version
jar -version
Ubuntu
Java Virtual Machine -JVM- location command (current JVM)Java Virtual Machine -JVM- location command (other JVMs)/usr/lib/jvm
Changing default JDK versionupdate-java-alternatives -l
[sudo] update-java-alternatives config java
Windows (see also ☛)
echo $env:java_home
Java 9 key enhancement is the introduction of modules (
module
keyword) in order to rationalize the overall core software functionality present in the JVM at execution time. JVM 9 is then decomposed into modules to avoid massive code functionality, which is not required at all by any user-defined app. To that extent, Java 9-based design of an app. arises from the “module” principle in the sense that developers have to isolate their code in execution-independent components (i.e., user-defined modules).The other notable extension is the availability of a Java source interpreter known as Java Shell -JShell-.
Rule(s)
- Much pre-programming code in the JVM may be excluded at run-time provided that any Java app. on the top of the executing JVM does not use this code; the footprint of the JVM becomes then lower for the Operating System -OS-. Typically, Java great functionalities, for instance Common Object Request Broker Architecture -CORBA- (
org.omg.CORBA
package) or Java Architecture for XML Binding -JAXB- (javax.xml.bind
package) have been removed from Java 11. Accordingly, JAXB from Java 11 then relies on the reuse of a third-party library ☛.- Beyond, from Java 9, a great effort is about optimization at large: representation of
String
instances in memory, redesign of metadata in.class
files, etc. In fact, numerous improvements related to Java 9, 10, 11… are hidden from the developer's perspective: JVM kernel rationalization through “componentization” targeting performance, security… issues.- Challenge is the design of a virtual machine with greater power and polyglotism: GraalVM™.
- Java data types ☛
- Java Object-Oriented Approach ☛
- Java Exception Handling ☛
- Java Generics and Collections ☛
- Java Streams and Lambda expressions ☛
- Java Platform Module System -JPMS- ☛
- Java Concurrency (including WebSockets) ☛
- Java I/O API ☛
- Java Security ☛
- Java DataBase Connectivity -JDBC- ☛
- Java Annotations ☛
- Java Persistence API -JPA- ☛
- Java Localization ☛
- Java Processing of JavaScript Object Notation -JSON- ☛