views:

170

answers:

2

Hi,

I downloaded the jdk-6u21-linux-x64-rpm.bin from Sun and installed the Java. During execution the rpm which got extracted is jdk-6u21-linux-amd64.rpm.

I am trying to build an application which requires libjvm.so. And in the above JDK it is found in /usr/java/jdk1.6.0_21/jre/lib/amd64/server/libjvm.so As a result , I am getting a compilation error as follows :

-lpegcommon -L/usr/java/jdk1.6.0_21/jre/lib/amd64/server -ljvm -ldl -lpthread -lcrypt
/usr/bin/ld: skipping incompatible /usr/java/jdk1.6.0_21/jre/lib/amd64/server/libjvm.so when searching for -ljvm
/usr/bin/ld: cannot find -ljvm
collect2: ld returned 1 exit status

where can I find a JDK rpm for x86_64? or an rpm where the libjvm.so is installed in
/usr/java/jdk1.6.0_21/jre/lib/x86_64/server/libjvm.so?

Thanks,

A: 

Since ultimately, it's an rpm you are installing, you can relocate the contents of the rpm wherever you want.

List the contents of the RPM: rpm -qpl jdk-6u21-linux-amd64.rpm, then for each base directory (/etc, /usr, \etc, \etc) you use a relocation statement. Say the RPM contains files in /etc and /usr/sbin, then to relocate /usr/sbin to /usr/local/sbin you would use rpm -i --relocate /usr/sbin=/usr/local/sbin jdk-6u21-linux-amd64.rpm.

pavanlimo
A: 

The RPM is okay.

IMHO have you checked the access rights to the path contining libjvm.so? Is it r-x for the current user?

Also can you try not mixing "-L" and "-l" switches (have all -L before any -l in your link command) 'cause gcc seems not to appreciate this mixing very much.

Daniel Voina