I've encountered some oddities with the way that java is setup on my F10 system while trying to learn some java stuff. When I try to run `mvn jetty:run` I get the following exception over and over:
""" java.lang.ClassCastException: gnu.java.nio.ServerSocketChannelImpl cannot be cast to java.nio.channels.SocketChannel """
I've traced that back to '/usr/lib/jvm/java' pointing to '/etc/alternatives/java_sdk' and that pointing to '/usr/lib/jvm/java-1.5.0-gcj'. When I do a `alternatives --config java` it shows '/usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java'. Typing `java -version` shows the correct version, but `/usr/lib/jvm/java/jre/bin/java -version` shows 1.5.0. On my F9 system the last command shows 1.6.0. I do have JPackage 5.0 (generic) stuff installed on both systems, and I have it set as an enabled repository normally.
I've tried `alternatives --set java_sdk /usr/lib/jvm/jre-1.6.0-openjdk.x86_64`, which is the path my F9 system is showing, but that didn't work.
Anyone have any ideas why this is set this way and how to fix it other than manually changing the symlinks?
Thanks!
--Caitlyn
On Tue, 2008-12-30 at 15:56 +0100, Kevin Kofler wrote:
Caitlyn O'Hanna wrote:
Anyone have any ideas why this is set this way and how to fix it other than manually changing the symlinks?
Try system-switch-java.
Kevin Kofler
That doesn't seem to have helped. Looking in '/etc/alternatives' it looks like it did touch java_sdk, but it is using gcj for both sets. I've attached the output of `ls -Al /etc/alternatives` while using either setting and the diff of the two so that one can see what it's doing at a glance.
While I had been thinking about it early this morning, I do recall that installing tomcat6 and deps with JPackage 5.0 enabled does change some things in '/etc/alternatives'. I'll probably be trying to uninstall all of that to see if that helps.
Thanks though :)
--Caitlyn
Caitlyn O'Hanna wrote:
On Tue, 2008-12-30 at 15:56 +0100, Kevin Kofler wrote:
Caitlyn O'Hanna wrote:
Anyone have any ideas why this is set this way and how to fix it other than manually changing the symlinks?
Try system-switch-java.
Kevin KoflerThat doesn't seem to have helped. Looking in '/etc/alternatives' it looks like it did touch java_sdk, but it is using gcj for both sets. I've attached the output of `ls -Al /etc/alternatives` while using either setting and the diff of the two so that one can see what it's doing at a glance.
While I had been thinking about it early this morning, I do recall that installing tomcat6 and deps with JPackage 5.0 enabled does change some things in '/etc/alternatives'. I'll probably be trying to uninstall all of that to see if that helps.
Thanks though :)
--Caitlyn
Just a tip, use galternative - it is a lot simpler imho.
On Tue, 2008-12-30 at 19:19 -0800, Daniel B. Thurman wrote:
Caitlyn O'Hanna wrote:
Anyone have any ideas why this is set this way and how to fix it other than manually changing the symlinks?
So it was simpler than I was making it out to be. It helps to have java-1.6.0-openjdk-devel installed :) Yum had been defaulting to installing java-1.5.0-gcj-devel whenever something was requiring java-sdk, not OpenJDK's SDK.
On the bright side, I now know a couple of new ways of changing alternatives...
--Caitlyn