Konda Reddy R
Konda Reddy R

Reputation: 103

JDK 1.2 on Ubuntu

I want to install JDK 1.2 to compile my legacy project. I can't upgrade to latest JDK because of so many limitations. I downloaded it from Sun website and followed all the steps given in the linked page.

When I run javac -version I get the following error message:

$ /usr/local/jdk1.2.2/bin/javac -version
Error: can't find libjava.so

I installed my JDK in /usr/local/jdk1.2.2 location. (I am using Ubuntu 12.04 64 bit). Can someone please help?

Thanks in advance.

Upvotes: 3

Views: 1002

Answers (3)

John Mercier
John Mercier

Reputation: 1705

This is the same issue with installing jdk1.3.1 on newer system. Since uname -m returns x86_64, you have to add that option to some of the scripts:

/bin/.java_wrapper
/jre/bin/.java_wrapper
/jre/bin/realpath

add x86_64 as on of the cases for the i386 option example:

case "`uname -m`" in
    i[3-6]86  | ia32 | ia64 | i?86 | x86_64)
        proc=i386
        ;;

Just add "| x86_64" to the case statement at the top of each file.

At this point when you run java -version you will get a "Segmentation fault." I'm still not sure how to fix this...

Upvotes: 3

Garbage
Garbage

Reputation: 1520

Though I understand that there might be different reasons for using a specific version, but if you are using JDK 1.2 only because source code is Java 1.2 compatible, I think you can use -source (and / or -target) switch of latest JDK's javac to inform the source code compatibility.

For more information, please visit http://docs.oracle.com/javase/6/docs/technotes/tools/windows/javac.html

Upvotes: 2

Matteo
Matteo

Reputation: 14940

The java executable is not able to find the libjava.so shared library:

Check if you have a libjava.so file in your installation

$ find /usr/local/jdk1.2.2/ -name libjava.so

If not your installation is broken (and without any details it will be difficult to help you)

If the file is there you can try to add the directory where the file is located to LD_LIBRARY_PATH:

$ export LD_LIBRARY_PATH=/usr/local/jdk1.2.2/PATH_WHERE_LIBJAVA_SO_IS_LOCATED:$LD_LIBRARY_PATH

Upvotes: 1

Related Questions