2

I'm running java 7 on one of my Solaris servers. We need to run updates but when we do java 8 tries to install itself. This wouldn't be a big deal but it conflicts with another application we have running for some reason. Therefore, I am stuck using java 7 for the time being.

Is it possible to ignore java updates when I run pkg update? I am new to solaris and any help would be appreciated.

jrd1989
  • 628
  • 10
  • 35
  • Probably a better solution would be to figure out a way to create a custom Java 7 installation for the one application that needs Java 7, then let the OS-standard installation of Java do what the OS wants. By ignoring the OS-standard updates for Java, you're probably placing yourself outside of a supported configuration, perpetuating security issues in the OS that would be fixed by an updated Java installation, and also potentially breaking parts of the OS or any application that depend on an up-to-date Java 8. – Andrew Henle May 25 '17 at 10:24

1 Answers1

1

No, you can't ignore specific updates, and you need to be aware that the system itself may require a newer version of Java for its own use (some of Solaris' own components use Java).

I assume what your actual issue is not so much that Java 8 is being installed, but that you want /usr/bin/java to point at java7 by default. You can do that by using the "pkg set-mediator" command as documented here:

https://docs.oracle.com/cd/E53394_01/html/E54739/gmagn.html

So, in your case, after applying the update and after rebooting, you could do this:

pkg set-mediator -V 1.8 java

Be aware that once Java 7 is removed from Solaris (at some future date, that will likely happen), you would then need to manually reset the mediator:

pkg unset-mediator -V java

...so that it reverts to the system default.

Ultimately, your best option is as the other poster suggested -- use your own custom installation of Java for applications if you require a specific version. The Java package found in Solaris is primarily for the use of the operating system, not applications, and is updated frequently.

  • Thank you for the feedback. Our issue is that our software does not support java 8 at this point in time so when we update the link to java7 is removed and points to the newly installed java8. But with your suggestion, would it be correct to say we could use pkg set-mediator -V 1.7 java which would then force the server to use java 7 instead of the newly installed 8, or did I misunderstand that altogether? – jrd1989 Jun 13 '17 at 19:00
  • It would change any program that uses /usr/bin/java to use 1.7 instead of 1.8. That's likely what's happening in your case. Try it, and I suspect it will do what you want. Just be certain that the java 7 packages remain installed. – Shawn Walker-Salas Jun 13 '17 at 19:59