LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-17-2008, 04:54 PM   #1
ratcateme
Member
 
Registered: Feb 2008
Distribution: CentOS 5.4
Posts: 59

Rep: Reputation: 15
Installing JDK6


I have been wanting to run some java scripts on my CLI Centos 5.0 box
i have been compiling them on windows using JDK6 when i ran one on my linux box it said the Class version was incompatible.
Code:
Exception in thread "main" java.lang.ClassFormatError: day (unrecognized class file version)
   at java.lang.VMClassLoader.defineClass(libgcj.so.7rh)
   at java.lang.ClassLoader.defineClass(libgcj.so.7rh)
   at java.security.SecureClassLoader.defineClass(libgcj.so.7rh)
   at java.net.URLClassLoader.findClass(libgcj.so.7rh)
   at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.7rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
   at gnu.java.lang.MainThread.run(libgcj.so.7rh)
i ran java -version:
Code:
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20070626 (Red Hat 4.1.2-14)

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
so only 1.4 i downloaded JDK6_10 installed it ran java -version and it was the same no change.
i ran javac -version and it said
Code:
javac 1.6.0_10
and i am sure java comes in JDK but i downloaded JRE6 install it but same results
i have restarted and no change.
what have i missed?
 
Old 11-17-2008, 06:44 PM   #2
ratcateme
Member
 
Registered: Feb 2008
Distribution: CentOS 5.4
Posts: 59

Original Poster
Rep: Reputation: 15
i did some more testing and tried to install all the rpms manually like this
Code:
[root@ratcat javarpms]# ls -l
total 94088
-rw-r--r-- 1 root root 66455505 Nov 18 13:40 jdk-6u10-linux-i586.rpm
-rw-r--r-- 1 root root 19807285 Nov 18 13:40 jre-6u10-linux-i586.rpm
-rw-r--r-- 1 root root   482972 Nov 18 13:40 sun-javadb-client-10.4.1-3.1.i386.rpm
-rw-r--r-- 1 root root    34007 Nov 18 13:40 sun-javadb-common-10.4.1-3.1.i386.rpm
-rw-r--r-- 1 root root  3771833 Nov 18 13:40 sun-javadb-core-10.4.1-3.1.i386.rpm
-rw-r--r-- 1 root root   918250 Nov 18 13:40 sun-javadb-demo-10.4.1-3.1.i386.rpm
-rw-r--r-- 1 root root  4558557 Nov 18 13:40 sun-javadb-docs-10.4.1-3.1.i386.rpm
-rw-r--r-- 1 root root   182834 Nov 18 13:40 sun-javadb-javadoc-10.4.1-3.1.i386.rpm
[root@ratcat javarpms]# rpm -i *
        package sun-javadb-common-10.4.1-3.1 is already installed
        package jdk-1.6.0_10-fcs is already installed
        package jre-1.6.0_10-fcs is already installed
        package sun-javadb-client-10.4.1-3.1 is already installed
        package sun-javadb-core-10.4.1-3.1 is already installed
        package sun-javadb-demo-10.4.1-3.1 is already installed
        package sun-javadb-docs-10.4.1-3.1 is already installed
        package sun-javadb-javadoc-10.4.1-3.1 is already installed
[root@ratcat javarpms]# rpm -e *
error: package jdk-6u10-linux-i586.rpm is not installed
error: package jre-6u10-linux-i586.rpm is not installed
error: package sun-javadb-client-10.4.1-3.1.i386.rpm is not installed
error: package sun-javadb-common-10.4.1-3.1.i386.rpm is not installed
error: package sun-javadb-core-10.4.1-3.1.i386.rpm is not installed
error: package sun-javadb-demo-10.4.1-3.1.i386.rpm is not installed
error: package sun-javadb-docs-10.4.1-3.1.i386.rpm is not installed
error: package sun-javadb-javadoc-10.4.1-3.1.i386.rpm is not installed
[root@ratcat javarpms]# rpm -i *
s       package sun-javadb-common-10.4.1-3.1 is already installed
        package jdk-1.6.0_10-fcs is already installed
        package jre-1.6.0_10-fcs is already installed
        package sun-javadb-client-10.4.1-3.1 is already installed
        package sun-javadb-core-10.4.1-3.1 is already installed
        package sun-javadb-demo-10.4.1-3.1 is already installed
        package sun-javadb-docs-10.4.1-3.1 is already installed
        package sun-javadb-javadoc-10.4.1-3.1 is already installed
as you can see they are all there and when you try to remove them then are not installed but if you try to install them they are installed ?????????????

Scott.
 
Old 11-18-2008, 10:06 PM   #3
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
You need to change your default java using the update-alternatives command e.g.
Code:
update-alternatives --config java
There are other options available so take a look at the update-alternatives manual.
 
Old 11-19-2008, 02:59 AM   #4
ratcateme
Member
 
Registered: Feb 2008
Distribution: CentOS 5.4
Posts: 59

Original Poster
Rep: Reputation: 15
thanks for the reply but i ended up renaming the binary in /usr/bin
and symbolic linking the 1.6 binary from /usr/java/jdk1.6.0_10/bin/

Scott.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Toshiba Satellite 110CS installing pdf reader, installing linux nappy501 Linux - Laptop and Netbook 3 10-11-2008 10:45 AM
Problem with jdk6 koolKing123 Linux - Software 5 03-21-2008 03:36 PM
Uninstalling jdk6 valdezr1 Fedora 6 03-24-2007 10:06 PM
Installing JDK6? GSMD Debian 2 01-11-2007 11:01 AM
Installing the nvidia driver off the web site and installing rpm in ubuntu? darkhatter Ubuntu 3 02-19-2006 02:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration