x64 Redhat 所需的 JDK 1.6 rpm
我从Sun下载了jdk-6u21-linux-x64-rpm.bin并安装了Java。在执行过程中,提取的 rpm 是 jdk-6u21-linux-amd64.rpm。
我正在尝试构建一个需要 libjvm.so 的应用程序。在上面的JDK中,它位于/usr/java/jdk1.6.0_21/jre/lib/amd64/server/libjvm.so 结果,我收到如下编译错误:
-lpegcommon -L/usr/java/jdk1.6.0_21/jre/lib/amd64/server -ljvm -ldl -lpthread -lcrypt
/usr/bin/ld:搜索 -ljvm 时跳过不兼容的 /usr/java/jdk1.6.0_21/jre/lib/amd64/server/libjvm.so
/usr/bin/ld: 找不到 -ljvm
collect2: ld 返回 1 退出状态
在哪里可以找到 x86_64 的 JDK rpm?或安装了 libjvm.so 的 rpm
/usr/java/jdk1.6.0_21/jre/lib/x86_64/server/libjvm.so?
谢谢,
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,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
转速还可以。
恕我直言,您检查过包含 libjvm.so 的路径的访问权限吗?是当前用户的rx吗?
另外,您可以尝试不混合“-L”和“-l”开关(在链接命令中的任何-l之前都包含所有-L),因为gcc似乎不太喜欢这种混合。
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.
由于最终您要安装的是 rpm,因此您可以将 rpm 的内容重新定位到您想要的任何位置。
列出 RPM 的内容:
rpm -qpl jdk-6u21-linux-amd64.rpm
,然后对于每个基本目录(/etc、/usr、\etc、\etc)使用重定位语句。假设 RPM 包含 /etc 和 /usr/sbin 中的文件,那么要将 /usr/sbin 重新定位到 /usr/local/sbin,您可以使用 rpm -i --relocate /usr/sbin=/usr/local/ sbin jdk-6u21-linux-amd64.rpm。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 userpm -i --relocate /usr/sbin=/usr/local/sbin jdk-6u21-linux-amd64.rpm
.