Archives For November 30, 1999

Oracle announced the release of JDK 22 GA this Tuesday.

JDK 22 delivers 12 enhancements that are significant enough to warrant their own JDK Enhancement Proposals (JEPs), including seven preview features and one incubator feature. They cover improvements to the Java Language, its APIs, its performance, and the tools included in the JDK.
Continue Reading…

Oracle Java JDK 19 is out! Here are the new features and how to install instructions for Ubuntu users.

First, for Linux users the release now ported to support the RV64GV configuration of RISC-V, a general-purpose 64-bit ISA.

The release also introduced record patterns to deconstruct record values. Record patterns and type patterns can be nested to enable a powerful, declarative, and composable form of data navigation and processing. Though it’s a preview feature so far.

There are also 2 other preview features: a foreign function & memory API can interoperate with code and data outside of the Java runtime; a lightweight virtual threads that dramatically reduce the effort of writing, maintaining, and observing high-throughput concurrent applications; pattern matching for switch expressions and statements.

JDK 19 also introduced an API to express vector computations that reliably compile at runtime to optimal vector instructions, and an API for structured concurrency.

Other changes include:

  • New system properties for System.out and System.err.
  • upgrade Unicode support to 14.0
  • HTTPS channel binding support for Java GSS/Kerberos.
  • Support for PAC-RET protection on Linux/AArch64
  • Add a -providerPath option to jarsigner
  • New options for ktab to provide Non-Default salt
  • As well, there are removed and deprecated APIs and features. See release note details.

How to Install Java JDK 19 in Ubuntu Linux:

Oracle website provides the 64-bit DEB/RPM packages for Debian, Ubuntu, Fedora based systems. Just go download the package for your system from the link below:

In recent Linux systems, you can simply double-click on the package to install via system Software App. To set the Java home variable and use JDK 19 as default, see this step by step how to tutorial.

This simple tutorial shows how to install the latest Oracle Java (JDK 21 so far) in Ubuntu Linux via the official binary package.

There used to be unofficial Ubuntu PPA to automate the process of installing Java JDK and setup the environment, however, discontinued. So, here’s the tutorial to manually install the Java package and set as default.

Install JDK 21 in Ubuntu:

Press Ctrl+Alt+T on keyboard to open a terminal window and follow the steps below one by one.

1. Download Java package

Firstly, go to oracle website and select download the .deb package:

It’s the 64-bit .deb package for modern PC and laptops, or tarball for ARM cpu architecture.

2. Install the .deb package

Once you downloaded the package, open terminal (Ctrl+Alt+T) and run the command below to install the deb package:

sudo apt install ~/Downloads/jdk-21_linux-x64_bin.deb

Here you may also double-click the .deb in file manager to install it via Ubuntu Software App.

For the ARM package (for Raspberry Pi, Apple M1/2, etc), run command to create ‘/usr/lib/jvm’ directory in case it does not exist:

sudo mkdir -p /usr/lib/jvm

Then, extract the tarball to that directory via:

sudo tar -zxf ~/Downloads/jdk-21_linux-aarch64_bin.tar.gz -C /usr/lib/jvm/

3. Set JDK 21 as default (for ARM only):

UPDATE: The .deb package now automatically set Java 21 as default! So, you ONLY need to follow the steps below for the ARM package.

It installs the files into ‘/usr/lib/jvm/jdk-21/‘ directory. To set it as default, do the following 2 steps one by one.

a.) Create symbolic links for the executable files:

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-21/bin/java 1
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-21/bin/javac 1
sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk-21/bin/jar 1

Similarly, add links for other executable files (e.g., jarsigner, jlink, javadoc) as you need.

b.) Next, run the commands below one by one, and type number to select Java JDK 21 as default.

sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config jar

When done, verify by running command in terminal:

java -version
javac -version

4. Set JAVA_HOME (for ARM only):

As well, you only need to do this for ARM package. If installed the .deb version, just verify JAVA HOME via the bottom command.

Option 1.) Set JAVA_HOME for current command console, that will work until you close it:

export JAVA_HOME=/usr/lib/jvm/jdk-21
setenv JAVA_HOME=/usr/lib/jvm/jdk-21

Option 2.) To make it permanent, create and edit config file via command:

sudo gedit /etc/profile.d/jdk.sh

Depends on your desktop environment, you may replace gedit with mousepad for XFCE, xed for Linux Mint, pluma for MATE, kate for KDE Plasma, gnome-text-editor for Ubuntu 23.04+.

then add following lines:

export J2SDKDIR=/usr/lib/jvm/jdk-21
export J2REDIR=/usr/lib/jvm/jdk-21
export PATH=$PATH:/usr/lib/jvm/jdk-21/bin:/usr/lib/jvm/jdk-21/db/bin
export JAVA_HOME=/usr/lib/jvm/jdk-21
export DERBY_HOME=/usr/lib/jvm/jdk-21/db


And create anther one for C shell:

sudo gedit /etc/profile.d/jdk.csh

add following lines and save it:

setenv J2SDKDIR /usr/lib/jvm/jdk-21
setenv J2REDIR /usr/lib/jvm/jdk-21
setenv PATH ${PATH}:/usr/lib/jvm/jdk-21/bin:/usr/lib/jvm/jdk-21/db/bin
setenv JAVA_HOME /usr/lib/jvm/jdk-21
setenv DERBY_HOME /usr/lib/jvm/jdk-21/db


Finally, change the permissions via command, and it should take place next time you log in.

sudo chmod +x /etc/profile.d/jdk.csh /etc/profile.d/jdk.sh

To verify JAVA HOME, run the command below in terminal at next login:

java -XshowSettings:properties -version

Uninstall Java JDK 21

To uninstall the Java package, open terminal (Ctrl+Alt+T) and run command:

sudo apt remove --autoremove jdk-21

For the ARM version, simply remove all the installed files, by running the commands below one by one:

  • Remove the alternative links:
    sudo update-alternatives --remove java /usr/lib/jvm/jdk-21/bin/java
    sudo update-alternatives --remove javac /usr/lib/jvm/jdk-21/bin/javac
    sudo update-alternatives --remove jar /usr/lib/jvm/jdk-21/bin/jar
  • Remove JDK installation files:
    sudo rm -R /usr/lib/jvm/jdk-21
  • And remove JAVA HOME config files:
    sudo rm /etc/profile.d/jdk.sh
    sudo rm /etc/profile.d/jdk.csh

Oracle announced the release of Java 17 as the new Long-Term Support (LTS) release.

Java 17 LTS comes with thousands of performance, stability, and security updates, as well as 14 JEPs (JDK Enhancement Proposals). And Oracle will provide 8-year support for the release with security, performance, and bug-fix updates until 2029.

According to the release note, the next LTS will be Java 21 planned for September 2023, which changes the LTS release circle for every three years to two years.

What’s New in Oracle Java 17:

JDK 17 includes new language enhancements, updates to the libraries, support for new Apple computers, removals and deprecations of legacy features, and work to ensure Java code written today will continue working without change in future JDK versions. It also offers a language feature preview and incubating APIs to gather feedback from the Java community.

Updates in the release include:

  • Sealed classes and interfaces restrict which other classes or interfaces may extend or implement them.
  • Restore Always-Strict Floating-Point Semantics
  • New interface types and implementations for Pseudo-Random Number Generators (PRNGs), including jumpable PRNGs and an additional class of splittable PRNG algorithms (LXM).
  • Implement a Java 2D pipeline for macOS using the Apple Metal API.
  • New Arm 64-based Apple Silicon computers support.
  • Deprecate the Applet API for removal
  • Remove the Remote Method Invocation (RMI) Activation mechanism
  • Remove the Experimental AOT and JIT Compiler
  • Deprecate the Security Manager for removal
  • Strongly encapsulate all internal elements of the JDK, except for critical internal APIs such as sun.misc.Unsafe.
  • Pattern matching for switch expressions and statements, along with extensions to the language of patterns.
  • Improves Foreign Function and Memory API and Vector API.

How to Install Oracle Java 17 in Ubuntu:

Thanks to the “Linux Uprising” team ppa, an installer script has been created to automatically downloads and installs Oracle JDK 17 package, and sets Java 17 as the default Java version (setting JAVA_HOME, etc.) on 64-bit PC and arm64 devices, e.g., Rasperry Pi and Microsoft HoloLens 2.

1.) Firstly, open terminal either from system start menu or by pressing Ctrl+Alt+T on keyboard. When it opens, run command to add the PPA:

sudo add-apt-repository ppa:linuxuprising/java

Type user password when it asks (no asterisk feedback) and hit Enter to continue.

2.) Refresh system package cache. The PPA provides packages for Ubuntu 18.04, Ubuntu 20.04, Ubuntu 21.04, Ubuntu 21.10, as well as two old Ubuntu LTS (14.04 and 16.04). And old Ubuntu releases need to manually update system cache by running the command below in terminal:

sudo apt-get update

3.) Finally install the script package via command:

sudo apt-get install oracle-java17-installer

Once the script starts, it brings you to the screen for the license. Press Tab key on keyboard to select OK and hit Enter.

Then answer “Yes” via arrow keys and hit Enter to start downloading Java 17 package from oracle website.

Terminal will indicate the downloading and installing process for you. When everything’s done successfully, use java --version or javac --version command to verify the installation.

That’s all. Enjoy!

Jetbrains announced the release of IntelliJ IDEA 2018.2.3 a day ago with various bug-fixes and some improvements for v2018.2.

IntelliJ IDEA 2018.2.3 release highlights:

  • Ability to open HTML files in Edge using the Open in Browser action.
  • Fixed IntelliJ IDEA freezes.
  • Git: The built-in SSH doesn’t fail when Git protocol version 2 is enabled.
  • Fixed regressions in Mercurial support.
  • Docker: the IDE now validates Command line options and reports unknown options.
  • Docker: volume mounting now works on Windows using Linux containers.
  • Minor Gradle bug-fixes.

How to Insall the Latest IntelliJ IDEA in Ubuntu:

It’s quite easy to install the latest IDEA packages in Ubuntu since Jetbrains offers official snap (containerised software package) package in snappy store.

Simply open Ubuntu Software, search for and you’ll see IDEA ultimate and community packages available for install.

NOTE for Ubuntu 16.04 users who never installed a snap package, make sure snapd is installed by running command in terminal (Ctrl+Alt+T):

sudo apt install snapd snapd-xdg-open

Eclipse 4.8 Photon was released a week ago. You can now install it in Ubuntu 18.04, Ubuntu 17.10, Ubuntu 16.04 easily via snap package.

Eclipse Photon release highlights:

  • Full Eclipse IDE user experience for building, debugging, running and packaging Rust applications.
  • Expanded C# editing and debug capabilities, including syntax coloring, autocomplete suggestions, code diagnostics, and code navigation tools.
  • Java 9, Java 10 and JUnit 5 support.
  • Dark theme improvements in text colors, background color, popup dialogs, mark occurrences, and more.

How to Install Eclipse 4.8 Photon in Ubuntu:

The community has built the snap package of Eclipse Photon. It’s an universal Linux package format that bundles all its dependencies, and auto-updates itself once a new release is published.

The Eclipse 4.8.0 snap can by easily installed in Ubuntu Software:

Note that there are two versions of Eclipse in Ubuntu Software. Take a look at the version number before installing the package.

You can also install the snap by running command in terminal:

snap install --classic eclipse

In addition:

1. For Ubuntu 16.04 users never installed a snap package, make sure snapd daemon is installed via command:

sudo apt-get install snapd snapd-xdg-open

2. For Java environment, either install the OpenJDK via command:

sudo apt-get install default-jre

For Oracle Java 8 or Java 10, see this how to tutorial.

The first bug-fix release of IntelliJ IDEA 2018.1 was released a few days ago with several important and critical bug-fixes.

IntelliJ IDEA 2018.1.1 includes following fixes:

  • An important fix that restores the automatic check for updates.
  • The keystrokes aren’t lost during freezing anymore
  • Clicking the Replace all option from the Replace in path dialog doesn’t cause the IDE to freeze
  • Issue with broken JPS that inhibits all non-gradle Android builds
  • Facet settings stored externally are now loaded by the build process
  • support for annotationProcessorPaths option in the maven-compiler-plugin 3.5 for external dependencies.
  • Performance for scrolling huge text file on 4K monitors was improved
  • The issue with AWT popups, which were above other process windows after alt-tab, was fixed

Install IntelliJ IDEA 2018.1.1 in Ubuntu:

Jetbrains offers official snap packages for Ubuntu Linux users. You can install it in Ubuntu 16.04, Ubuntu 17.10, Ubuntu 18.04 via following steps.

1. (Ubuntu 16.04 only) For those who never installed a snap package, open terminal (Ctrl+Alt+T) and run command to install snapd daemon:

sudo apt-get install snapd snapd-xdg-open

No visual feedback while typing your password due to security reason.

2. Then you can search for and install IDEA via Ubuntu Software:

Or run command in terminal instead to install the IDE:

snap install intellij-idea-community --classic

For the ultimate edition, replace intellij-idea-community with intellij-idea-ultimate in the code.

IntelliJ IDEA Reached 2017.3.2 with Numerous Fixes

Last updated: December 26, 2017

IntelliJ IDEA 2017.3.2 was released earlier today with some new features and numerous bug-fixes.

New Features in IntelliJ IDEA 2017.3.2 includes:

  • Support Heroku API v3
  • Add dedicated support for java.time.Duration in config files
  • Spring Boot: Endpoints: support new SB 2.0.0 properties for managing actuator endpoints
  • Allow configure vuejs interpolation literals
  • Node debugging: allow to override default debug options passed to Node
  • ES6: Copy-paste support. Add imports for referenced exported elements
  • Support authorization with Basic or Digest
  • TypeScript service: if project contains only one root tsconfig.json use the config options for all files from the project
  • And see the release note for bug-fixes.

How to Install IntelliJ IDEA 2017.3.2 in Ubuntu:

There are a few ways to run the latest release of the Java IDE in Ubuntu desktop. And here are 3 of them:

method 1: Download official Linux package (NON-INSTALL), extract and run the executable to launch the IDE:

Download IntelliJ IDEA for Linux

method 2: Install the Snap package (runs in sandbox) for Ubuntu 16.04 and higher:

Open terminal via Ctrl+Alt+T or by searching ‘terminal’ from app launcher. When it opens, run command:

sudo snap install intellij-idea-community --classic

Replace intellij-idea-community with intellij-idea-ultimate for ultimate edition. And type your password (no visual feedback) when it asks.

method 3: Install the traditional .deb package via PPA to get the official Linux package and install the application shortcut automatically.

To do so, open terminal (Ctrl+Alt+T) and run following commands one by one to add the PPA and install the .deb packages:

sudo add-apt-repository ppa:ubuntuhandbook1/apps

sudo apt-get update

sudo apt-get install intellij-idea-community

Also replace intellij-idea-community in the code with intellij-idea-ultimate for ultimate edition.

Uninstall:

For the snap packages, you can either remove them from Ubuntu Software, or by running command in terminal:

sudo snap remove intellij-idea-community intellij-idea-ultimate

For the PPA packages, remove them either via Synaptic package manager, or by running command in terminal:

sudo apt-get remove --autoremove intellij-idea-community intellij-idea-ultimate

And you can remove the PPA via “Software & Updates” utility under Other Software tab.

The first update for IntelliJ IDEA 2017.3 series was release a day ago with few bug fixes.

IntelliJ IDEA 2017.3.1 fixed:

  • Groovy: Intellisence does not work in Groovy code
  • JavaScript.Frameworks: Freezes when switching git branches

How to Install IntelliJ IDEA 2017.3.1 in Ubuntu:

There are a few ways to run the latest release of the Java IDE in Ubuntu desktop. And here are 3 of them:

method 1: Download official Linux package (NON-INSTALL), extract and run the executable to launch the IDE:

Download IntelliJ IDEA for Linux

method 2: Install the Snap package (runs in sandbox) for Ubuntu 16.04 and higher:

Open terminal via Ctrl+Alt+T or by searching ‘terminal’ from app launcher. When it opens, run command:

sudo snap install intellij-idea-community --classic

Replace intellij-idea-community with intellij-idea-ultimate for ultimate edition. And type your password (no visual feedback) when it asks.

method 3: Install the traditional .deb package via PPA to get the official Linux package and install the application shortcut automatically.

To do so, open terminal (Ctrl+Alt+T) and run following commands one by one to add the PPA and install the .deb packages:

sudo add-apt-repository ppa:ubuntuhandbook1/apps

sudo apt-get update

sudo apt-get install intellij-idea-community

Also replace intellij-idea-community in the code with intellij-idea-ultimate for ultimate edition.

Uninstall:

For the snap packages, you can either remove them from Ubuntu Software, or by running command in terminal:

sudo snap remove intellij-idea-community intellij-idea-ultimate

For the PPA packages, remove them either via Synaptic package manager, or by running command in terminal:

sudo apt-get remove --autoremove intellij-idea-community intellij-idea-ultimate

And you can remove the PPA via “Software & Updates” utility under Other Software tab.

Jet Brains announced the release of IntelliJ IDEA 2017.3 earlier today. Here’s how to install it in Ubuntu 14.04, Ubuntu 16.04, Ubuntu 17.10, and Ubuntu 18.04.

IntelliJ IDEA 2017.3 is a new massive release that includes loads of new features and dozens of important bugfixes. See the release note for details.

How to Install IntelliJ IDEA 2017.3 in Ubuntu:

There are a few ways to run the latest release of the Java IDE in Ubuntu desktop. And here are 3 of them:

method 1: Download official Linux package (NON-INSTALL), extract and run the executable to launch the IDE:

Download IntelliJ IDEA for Linux

method 2: Install the Snap package for Ubuntu 16.04 and higher:

Open terminal via Ctrl+Alt+T or by searching ‘terminal’ from app launcher. When it opens, run command:

sudo snap install intellij-idea-community --classic

Replace intellij-idea-community with intellij-idea-ultimate for ultimate edition. And type your password (no visual feedback) when it asks.

method 3: Install the traditional .deb package via PPA to get the official Linux package and install the application shortcut automatically.

To do so, open terminal (Ctrl+Alt+T) and run following commands one by one to add the PPA and install the .deb packages:

sudo add-apt-repository ppa:ubuntuhandbook1/apps

sudo apt-get update

sudo apt-get install intellij-idea-community

Also replace intellij-idea-community in the code with intellij-idea-ultimate for ultimate edition.

Uninstall:

For the snap packages, you can either remove them from Ubuntu Software, or by running command in terminal:

sudo snap remove intellij-idea-community intellij-idea-ultimate

For the PPA packages, remove them either via Synaptic package manager, or by running command in terminal:

sudo apt-get remove --autoremove intellij-idea-community intellij-idea-ultimate

And you can remove the PPA via “Software & Updates” utility under Other Software tab.