Tuesday, February 25, 2020

Install Oracle Java 11 on Ubuntu 18.04.4 LTS

Oracle Java 11 is a Long-Term Support (LTS) version widely used for enterprise applications, web servers, and development environments. Unlike OpenJDK, Oracle Java comes with commercial support and additional features.

This guide will show you step-by-step how to install Oracle Java 11 on Ubuntu 18.04.4 LTS.


Open the terminal and type these command in the terminal.

Step 1: Create a Local Installer Directory

Oracle Java installer requires a local cache directory. Run:

sudo mkdir -p /var/cache/oracle-jdk11-installer-local/


This creates a folder where the installer will look for the downloaded .tar.gz file.

Step 2: Move the Downloaded JDK File

Navigate to the folder where you downloaded the Oracle JDK 11 .tar.gz file:

cd ~/Downloads


Then copy the file to the local installer directory:

sudo cp jdk-11.0.6_linux-x64_bin.tar.gz /var/cache/oracle-jdk11-installer-local/

Step 3: Remove Previous Oracle Java 11 (Optional)

If you have a previously installed Oracle Java 11, remove it first:

sudo apt purge oracle-java11-installer


This ensures a clean installation.

Step 4: Add the Linux Uprising PPA

Add the Linux Uprising PPA to get the Oracle Java installer:

sudo add-apt-repository ppa:linuxuprising/java
sudo apt-get update

Step 5: Install Oracle Java 11

Install the local Oracle Java 11 installer:

sudo apt install oracle-java11-installer-local

Step 6: Set Oracle Java 11 as Default

To set Java 11 as the default version for your system, run:

sudo apt install oracle-java11-set-default-local

     



Thursday, February 25, 2016

iReport Designer(5.6.0) cannot open in JDK 8

I was trying to change the jdkhome using jdk 8 with iReport Designer 5.6.0. But I had failed.Then I installed jdk 7 and changed the jdkhome as jdk 7.After that I have successfully installed iReport Designer.

These are the steps.

Why This Happens

iReport 5.6.0 was released before JDK 8, so some classes and libraries are incompatible with the newer Java runtime.

Attempting to run iReport with JDK 8 will result in the program failing to start, with no clear error message.

Step-by-Step Solution
1. Install JDK 7

Download and install Java Development Kit (JDK) 1.7 from Oracle’s archive:
Oracle JDK 7 Downloads

Install it in a folder like:

C:\Program Files\Java\jdk1.7.0_45

2. Update iReport Configuration

Go to the iReport installation folder. For example:

C:\Program Files\iReport-5.6.0\etc


Open the ireport.conf file with a text editor (like Notepad).

Find the line for jdkhome. It might look like:

#jdkhome="/path/to/jdk"


Change it to point to your JDK 7 folder, not the JRE:

jdkhome="C:/Program Files/Java/jdk1.7.0_45"


Save the file.

Do not point it to the jre folder—iReport requires the full JDK.

3. Run iReport

Double-click ireport.exe in your iReport installation folder.

The application should now start successfully using JDK 7.

 Additional Tips

If you have multiple JDK versions installed, ensure JDK 7 is set in iReport even if JDK 8 is your system default.

For Eclipse or NetBeans integration, configure the project’s Java Compiler to use JDK 7 for iReport compatibility.

Friday, February 20, 2015

WindowsPreferences WARNING: Could not open/create

While running GWT (Google Web Toolkit) applications in Eclipse on Windows, you might encounter the following warning:

feb 20, 2015 4:13:54 pm java.util.prefs.windowspreferences <init> warning: could not open/create prefs root node software\javasoft\prefs at root 0x80000002. windows regcreatekeyex(...) returned error code 5.

Answer is:
This happens because the Java runtime cannot access or create the Windows registry node where it stores preferences.

Why This Happens

Java stores preferences for applications in the Windows registry at HKEY_LOCAL_MACHINE\Software\JavaSoft\Prefs.

If this key doesn’t exist or your user doesn’t have administrator rights, Eclipse/GWT cannot write preferences, causing this warning.

Error code 5 indicates access denied.

Step-by-Step Fix
1. Open the Registry Editor

Press Windows + S (search) and type:

regedit


Press Enter to open the Registry Editor.
Be careful when editing the registry; incorrect changes can affect your system.

2. Navigate to JavaSoft Key

Go to the following path in the Registry Editor:

HKEY_LOCAL_MACHINE\Software\JavaSoft

3. Create the Prefs Key

Right-click the JavaSoft folder.

Choose New → Key.

Rename the new key to:

Prefs

4. Verify Permissions

Ensure that your user account has read/write permissions on the Prefs key.

If needed, right-click → Permissions → Add your user and give Full Control.

5. Restart Eclipse

Close Eclipse and restart it.

The warning should no longer appear when running your GWT application.

Additional Notes

This warning is harmless in most cases, but fixing it ensures that preferences are saved properly.

If you are using a 64-bit Windows system and 32-bit Java, the path might be:

HKEY_LOCAL_MACHINE\Software\Wow6432Node\JavaSoft


Always back up your registry before making changes.


Wednesday, February 11, 2015

Convert .zip file to .war file

If you need to convert .zip file to .war file, go through following steps.

Method 1: Simple Rename (if .zip already has WAR structure)

1. Copy the .zip file into your project directory.
Example: HelloWorld.zip

2. Open a terminal or command prompt.

3. Run the rename command:

Windows (cmd):

ren HelloWorld.zip HelloWorld.war


Linux/macOS (bash):

mv HelloWorld.zip HelloWorld.war


Now you can deploy HelloWorld.war into your application server (Tomcat, GlassFish, WildFly, etc.).