How to uninstall java jdk6 and jre6 from Solaris 11 x86 OS? and install java7? How to set the path and class path?
Personally I've found it best not to touch the Java that is used by the OS. Let it live its own life.
I simply install the
As an example my
In other words: Lots of directories that represent JREs or JDKs I've installed (read: unpacked) over the years. The directory names actually create themselves when you unpack. As you can see I use symbolic links to centralize version handling.
If I have an application which I would like to use JRE7 then I would simply make sure that I set the
This will make sure my application uses Java 7.
You ask also about classpath. That question has nothing to do with the java core. Once you've set your
You cannot remove the JDK/JRE that the OS applications are using. Period. But you can
for example in Solaris 11/11 the OS has JRE6 and several apps installed rely on JRE6. You CANNOT remove it. You can update it to a higher version of 6. In this case you can also install or remove JRE7 or 8 with IPS. Adding only JRE7 does not change the applictions that are still reliant on JRE6.
If you update the OS (such as "pkg update --accept") this will likely update all the apps that rely on the JRE as well. Now you have them all rely on say JRE7. When this happens you can no longer remove 7 (which the update installed), but you can update it to a higher version of 7. You can also install/uninstall JRE8 since it is not tied to the system.
This is true for whatever version of Solaris 11 and up (yes 12 also) you have.
By the way to downgrade the JRE you update it - you point to a prior version and update to that version. If you have a repository that has say 7u45 and 7u60, when you updated you have 7u60. If you want to go back to 7u45 you specify it like this
pkg update pkg://firstname.lastname@example.org
By the way installing SVR4 packages (pkgadd) on Solaris 11 and up for Java is NOT supported. IPS is the preferred and supported way to put Java on your system. If you need multiple family versions, one should use the .gz or other compressed bundles and drop it in a custom location.