Linux 上的 Java 警告

Linux 上的 Java 警告

您好,我在 kubuntu 11.10 上安装 Java 后收到警告。Java 程序运行,但我总是收到 4 个警告:

$ java
Warning: no leading - on line 1 of `/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/amd64/jvm.cfg'
Warning: missing VM type on line 1 of `/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/amd64/jvm.cfg'
Warning: no leading - on line 1 of `/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/amd64/jvm.cfg'
Warning: missing VM type on line 1 of `/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/amd64/jvm.cfg'

我遗漏了什么?提前致谢!

以下是文件内容 /usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/amd64/jvm.cfg :

/usr/lib/jvm/java-6-sun
#
# %W% %E%
#
# Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
# ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
#
# List of JVMs that can be used as an option to java, javac, etc.
# Order is important -- first in this list is the default JVM.
# NOTE that this both this file and its format are UNSUPPORTED and
# WILL GO AWAY in a future release.
#
# You may also select a JVM in an arbitrary location with the
# "-XXaltjvm=<jvm_dir>" option, but that too is unsupported
# and may not be available in a future release.
#
-server KNOWN
-client IGNORE
-hotspot ERROR
-classic WARN
-native ERROR
-green ERROR

答案1

您是否已完成下列程序?

打开终端并运行以下命令

使用以下命令添加合作伙伴存储库

sudo add-apt-repository “deb http://archive.canonical.com/ lucid partner”

更新源列表

sudo apt-get update

现在使用以下命令安装 sun java 包

sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts

上述命令将下载所有必需的软件包并开始安装,您将看到一个包含 Java 的 Sun 操作系统分销商许可证的屏幕,按 Enter 继续。

您将看到一个对话框,询问您是否同意 DLJ 许可条款。选择“是”,然后按 Enter;JRE 将完成安装。

测试 Java 运行时环境

您需要确认您的系统已正确配置 Sun 的 JRE。此过程分为两个步骤。

首先,通过从终端运行以下命令检查 JRE 是否正确安装。

答案2

问题是in文件#之前的第一行缺失了。我还没搞清楚为什么会缺失。现在它工作正常,没有任何警告。谢谢。/usr/lib/jvm/java-6-sunjvm.cfg

相关内容