SUN Java, update-alternatives on CentOS
There seem to be too many version of java on my machine right now. To add to my misery there is openjdk, gcj, sun java 1.4, 1.5, 1.6 all install. However unix allows for quick configuration of jvms using update-alternatives.
To install/ register a JVM use the following
/usr/sbin/alternatives --install "/usr/bin/java" "java" "/usr/java/default/bin/java" 2 /usr/sbin/alternatives --install "/usr/bin/javac" "javac" "/usr/java/default/bin/javac" 2
And to configure systemwide changes use
/usr/sbin/alternatives --configure java /usr/sbin/alternatives --configure javac
nice, this is just what i needed. Thanks!
john
November 17, 2011 at 1:13 am
Awesome. Good to hear.
AJ
anujjaiswal
January 6, 2012 at 5:14 pm
[...] See this blog [...]
Hongyu's weblog » Change Java environment in CentOS
December 28, 2011 at 2:47 am
Thanks for that tip but you answer can be improved upon.
Please see this version:
http://stackoverflow.com/a/9179769
Ken
February 7, 2012 at 12:43 pm
Yes, very cool.
anujjaiswal
February 15, 2012 at 2:29 pm