AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 14114
Accepted
Alex Black
Alex Black
Asked: 2010-11-20 19:20:03 +0800 CST2010-11-20 19:20:03 +0800 CST 2010-11-20 19:20:03 +0800 CST

sun-java6-jdk 安装疑难解答

  • 772
  1. 刚刚在新机器上完成了 Ubuntu 10.10 的全新安装
  2. 我通过 ubuntu 软件中心添加了合作伙伴存储库
  3. 我跑了'sudo apt-get install sun-java6-jdk'
  4. 我运行了 'sudo update-java-alternatives -s java-6-sun' 并得到了这个错误:
alex@alex-home:~$ sudo update-java-alternatives -s java-6-sun
update-alternatives:错误:mozilla-javaplugin.so 没有替代品。
update-alternatives:错误:xulrunner-1.9-javaplugin.so 没有替代品。
update-alternatives:错误:mozilla-javaplugin.so 没有替代品。
update-alternatives:错误:xulrunner-1.9-javaplugin.so 没有替代品。

仔细检查失败,我仍在 JRE 上:

alex@alex-home:~$ java -version
java版本“1.6.0_22”
Java(TM) SE 运行时环境 (build 1.6.0_22-b04)
Java HotSpot(TM) 64 位服务器 VM(内部版本 17.1-b03,混合模式)
alex@alex-home:~$

也试过这个:

alex@alex-home:~$ sudo update-alternatives --config java
替代 java 有 2 种选择(提供 /usr/bin/java)。

  选择路径优先状态
-------------------------------------------------- ----------
  0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 自动模式
  1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 手动模式
* 2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 手动模式

按回车键保留当前选择[*],或输入选择编号:

JDK 没有列出,但它在磁盘上列出:

alex@alex-home:~$ ls /usr/lib/jvm/
默认-java java-1.6.0-openjdk java-6-openjdk java-6-sun java-6-sun-1.6.0.22

更新:

安装插件和字体导致 update-java-alternatives 停止抱怨,但仍然没有运气:

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

然后:

alex@alex-home:~$ sudo update-java-alternatives -s java-6-sun
alex@alex-home:~$ java -version
java版本“1.6.0_22”
Java(TM) SE 运行时环境 (build 1.6.0_22-b04)
Java HotSpot(TM) 64 位服务器 VM(内部版本 17.1-b03,混合模式)

更新2:嗯,也许它真的有效?我以为“...SE Runtime...”的意思是 JRE,但也许一切都好?

10.10 64-bit java jdk
  • 3 3 个回答
  • 6121 Views

3 个回答

  • Voted
  1. Best Answer
    Nick Pascucci
    2010-11-20T20:35:50+08:002010-11-20T20:35:50+08:00

    SE 运行时意味着您正在运行 Java 标准版,而不是企业版(AKA Servlets/JSP,它需要一个应用程序服务器)。你现在安装的应该没问题!如果您想开发 Java 程序,只需确保javac在您的系统上安装了它。

    编辑 另外,请确保 javac 是由 java-6-sun 提供的,否则您可能会使用似乎不是您想要的 GNU Java 编译器。

    • 2
  2. aneeshep
    2010-11-20T21:05:12+08:002010-11-20T21:05:12+08:00

    在终端尝试这个命令

    javac 
    

    如果你得到类似下面的输出,那么这意味着你已经安装了 java jdk。

    样本输出:

    Usage: javac <options> <source files>
    where possible options include:
      -g                         Generate all debugging info
      -g:none                    Generate no debugging info
      -g:{lines,vars,source}     Generate only some debugging info
      -nowarn                    Generate no warnings
      -verbose                   Output messages about what the compiler is doing
      -deprecation               Output source locations where deprecated APIs are used
      -classpath <path>          Specify where to find user class files and annotation processors
      -cp <path>                 Specify where to find user class files and annotation processors
      -sourcepath <path>         Specify where to find input source files
      -bootclasspath <path>      Override location of bootstrap class files
      -extdirs <dirs>            Override location of installed extensions
      -endorseddirs <dirs>       Override location of endorsed standards path
      -proc:{none,only}          Control whether annotation processing and/or compilation is done.
      -processor <class1>[,<class2>,<class3>...]Names of the annotation processors to run; bypasses default discovery process
      -processorpath <path>      Specify where to find annotation processors
      -d <directory>             Specify where to place generated class files
      -s <directory>             Specify where to place generated source files
      -implicit:{none,class}     Specify whether or not to generate class files for implicitly referenced files 
      -encoding <encoding>       Specify character encoding used by source files
      -source <release>          Provide source compatibility with specified release
      -target <release>          Generate class files for specific VM version
      -version                   Version information
      -help                      Print a synopsis of standard options
      -Akey[=value]              Options to pass to annotation processors
      -X                         Print a synopsis of nonstandard options
      -J<flag>                   Pass <flag> directly to the runtime system
    

    您还可以通过运行检查版本

    javac -version
    

    希望这可以帮助。

    • 1
  3. Benjamin
    2010-11-20T20:37:02+08:002010-11-20T20:37:02+08:00

    我确定您的“java -version”命令的输出是由 sun-java6-jre 包的 java 二进制文件生成的。这样你的安装就成功了。

    • 0

相关问题

  • GTK 改进何时会在 Maverick 上落地?

  • 目前是否有计划在“Maverick Meerkat”10.10 中用 Banshee 替换 Rhythmbox?

  • 什么是 btrfs?它有哪些高级功能?

  • 为什么在 Ubuntu 10.10 中 F-Spot 被 Shotwell 取代?

  • Haskell 平台会在 10.10 中可用吗?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何安装 .run 文件?

    • 7 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    如何获得 CPU 温度?

    • 21 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Marko Smith

    如何使用命令行将用户添加为新的 sudoer?

    • 7 个回答
  • Marko Smith

    更改文件夹权限和所有权

    • 9 个回答
  • Marko Smith

    你如何重新启动Apache?

    • 13 个回答
  • Marko Smith

    如何卸载软件?

    • 11 个回答
  • Marko Smith

    如何删除 PPA?

    • 26 个回答
  • Martin Hope
    NES 如何启用或禁用服务? 2010-12-30 13:03:32 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    Olivier Lalonde 如何在结束 ssh 会话后保持进程运行? 2010-10-22 04:09:13 +0800 CST
  • Martin Hope
    David B 如何使用命令行将用户添加为新的 sudoer? 2010-10-16 04:02:45 +0800 CST
  • Martin Hope
    Hans 如何删除旧内核版本以清理启动菜单? 2010-08-21 19:37:01 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve