While doing a package based install/uninstall someone should follow below steps to completely remove the corrupted Java from system
Here we have taken Solaris system as example as the issue(pkg) is seen here more often.
Please follow below instructions for a clean uninstallation of corrupt java packages from solaris systems.
1) To uninstall the Solaris packages for this version of the JDK, remove them by running:
On all processors:
pkgrm SUNWj6rt SUNWj6dev SUNWj6cfg SUNWj6man SUNWj6dmo
When trying to remove a corrupt Java SE install, the pkgrm commands may not successfully remove all files and/or directories, nor Product Registry entries. Take these extra steps to ensure the corrupt JDK/JRE is completely removed from the system before attempting re-install:
After removing all the SUNWj6* packages as per above instructions…
2) Check to make sure all files are removed from /var/sadm/install/contents:
/usr/bin/grep /usr/jdk/instances/jdk1.6.*. /var/sadm/install/contents
If something is returned, verify that the package was removed, and if so, manually remove the files and/or directories with the command:
/usr/bin/rm -r <file/directory>
Note: To remove files in root owned directories, such as /usr or /, you will need to run the /usr/bin/rm command as root.
3) Check to make sure the Product Registry entries are removed.
This brings up the Product Registry GUI(Need Xterm). Check for JDK 6.*. entries under either the Solaris System <vers> Software or Unclassified Software headings:
- System Registry - Solaris System <vers> Software -Java VM (Look at the sub-entries) -Java VM (64-bit) (Look at the sub-entries) -Unclassified Software -JDK 6.*.* (various entries)
If there are any JDK 6.*.* entries, uninstall them by selecting the entry you want removed and clicking the “Uninstall” button at the bottom of the GUI window. Only do this after removing all JDK 6.*. packages, and manually removing any files and/or directories that were not removed with the pkgrm commands. You will be prompted for root password when uninstalling from prodreg.
Uninstall only the 6.*. entries.
When all the following have been verified:
– the 6.*. packages have been removed
– the /var/sadm/install/contents have no more 6.*. entries
– the Product Registry has no more 6.*. entries
then you can attempt to install JDK 6.*. packages using the installation guide provided by Oracle.
Quick Command Example of Installation process:
On SPARC processors:
zcat jdk-6 <update> -solaris-sparc.tar.Z | tar -xf -
On x86/x64/EM64T processors:
zcat jdk-6 <update> -solaris-i586.tar.Z | tar -xf -
This creates several directories ( SUNWj6rt, SUNWj6dev, SUNWj6cfg, SUNWj6man, SUNWj6dmo, and SUNWj6jmp) plus a few files in the current directory.
su to root and run below commands:
This command installs the JDK into /usr/jdk/instances/jdk1.6.*
On all processors:
pkgadd -d . SUNWj6rt SUNWj6dev SUNWj6cfg SUNWj6man SUNWj6dmo
To check Java properly installed use java -version command and check /usr/jdk/instances/jdk1.6* for java installation files.