特殊:Badtitle/NS100:Java:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
(未显示2个用户的15个中间版本) | |||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/Java}} | {{From|https://help.ubuntu.com/community/Java}} | ||
{{Languages| | {{Languages|UbuntuHelp:Java}} | ||
'''Please do not make any edits to this article. Its contents are currently under review and being merged with the ''Ubuntu Server Guide''. To find the Ubuntu Server Guide related to your specific version, please go to:''' | |||
'''https://help.ubuntu.com/ and click on ''Ubuntu Server Guide''''' | |||
Sun Microsystems developed Java, which is many things depending on who you ask. It is a language, and an execution environment and probably many more things. On this page Java refers to the software that executes programs compiled to Java byte codes (akin to machine language). | |||
=== Running Java under Ubuntu === | |||
In order to run Java programs, you must have a Java run time environment (JRE) installed. To run Java web applets in your browser, you additionally need a plugin for your browser, which is not installed by default. To use Java Web Start applications, no browser plugin is necessary. The default flavor of JRE installed is defined by the package default-jre. Currently, it is openjdk-6-jre, which is mostly derived from the Sun JRE. | |||
To run Java applets using the plugin corresponding to OpenJDK, you must install the package <code><nowiki>icedtea6-plugin</nowiki></code> . | |||
Some Java applications may experience problems or worse problems under other JREs. Trial may be necessary. | |||
[[UbuntuHelp:JavaInstallation|JavaInstallation]] describes how to install some open source flavors of Java. | |||
To get Sun closed source Java under Ubuntu 7.04 or later running on Intel or PowerPC platform, enable the Universe repository in Add/Remove programs, and install the <code><nowiki>sun-java6-jre</nowiki></code> and <code><nowiki>sun-java6-plugin</nowiki></code> packages. | |||
For applet support in the browser, install <code><nowiki>sun-java6-plugin</nowiki></code> as well (Warning: PowerPC version is slow, Warning: sun-java6 incorrectly sizes fonts in the GTK Look And Feel). | |||
Note: The same commands will work under Xubuntu/Kubuntu (using Add/Remove or the Adept Package Installer). | |||
=== Choosing the default Java to use === | |||
Just installing new Java flavours does not change the default Java pointed to by /usr/bin/java. You must explicitly set this: | |||
* Open a Terminal window | |||
* Run <code><nowiki>sudo update-java-alternatives -l</nowiki></code> to see the current configuration and possibilities. | |||
* Run <code><nowiki>sudo update-java-alternatives -s XXXX</nowiki></code> to set the XXX java version as default. For Sun Java 6 this would be <code><nowiki>sudo update-java-alternatives -s java-6-sun</nowiki></code> | |||
* Run <code><nowiki>java -version</nowiki></code> to ensure that the correct version is being called. | |||
You can also use the following command to interactively make the change; | |||
* Open a Terminal window | |||
Java | * Run <code><nowiki>sudo update-alternatives --config java</nowiki></code> | ||
* Follow the onscreen prompt | |||
---- | |||
=== | |||
* | |||
* | |||
* | |||
* | |||
- | |||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2010年5月19日 (三) 23:00的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/Java }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/af | • {{#if: UbuntuHelp:Java|Afrikaans| [[::Java/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/ar | • {{#if: UbuntuHelp:Java|العربية| [[::Java/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/az | • {{#if: UbuntuHelp:Java|azərbaycanca| [[::Java/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/bcc | • {{#if: UbuntuHelp:Java|جهلسری بلوچی| [[::Java/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/bg | • {{#if: UbuntuHelp:Java|български| [[::Java/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/br | • {{#if: UbuntuHelp:Java|brezhoneg| [[::Java/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/ca | • {{#if: UbuntuHelp:Java|català| [[::Java/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/cs | • {{#if: UbuntuHelp:Java|čeština| [[::Java/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/de | • {{#if: UbuntuHelp:Java|Deutsch| [[::Java/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/el | • {{#if: UbuntuHelp:Java|Ελληνικά| [[::Java/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/es | • {{#if: UbuntuHelp:Java|español| [[::Java/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/fa | • {{#if: UbuntuHelp:Java|فارسی| [[::Java/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/fi | • {{#if: UbuntuHelp:Java|suomi| [[::Java/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/fr | • {{#if: UbuntuHelp:Java|français| [[::Java/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/gu | • {{#if: UbuntuHelp:Java|ગુજરાતી| [[::Java/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/he | • {{#if: UbuntuHelp:Java|עברית| [[::Java/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/hu | • {{#if: UbuntuHelp:Java|magyar| [[::Java/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/id | • {{#if: UbuntuHelp:Java|Bahasa Indonesia| [[::Java/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/it | • {{#if: UbuntuHelp:Java|italiano| [[::Java/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/ja | • {{#if: UbuntuHelp:Java|日本語| [[::Java/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/ko | • {{#if: UbuntuHelp:Java|한국어| [[::Java/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/ksh | • {{#if: UbuntuHelp:Java|Ripoarisch| [[::Java/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/mr | • {{#if: UbuntuHelp:Java|मराठी| [[::Java/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/ms | • {{#if: UbuntuHelp:Java|Bahasa Melayu| [[::Java/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/nl | • {{#if: UbuntuHelp:Java|Nederlands| [[::Java/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/no | • {{#if: UbuntuHelp:Java|norsk| [[::Java/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/oc | • {{#if: UbuntuHelp:Java|occitan| [[::Java/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/pl | • {{#if: UbuntuHelp:Java|polski| [[::Java/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/pt | • {{#if: UbuntuHelp:Java|português| [[::Java/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/ro | • {{#if: UbuntuHelp:Java|română| [[::Java/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/ru | • {{#if: UbuntuHelp:Java|русский| [[::Java/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/si | • {{#if: UbuntuHelp:Java|සිංහල| [[::Java/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/sq | • {{#if: UbuntuHelp:Java|shqip| [[::Java/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/sr | • {{#if: UbuntuHelp:Java|српски / srpski| [[::Java/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/sv | • {{#if: UbuntuHelp:Java|svenska| [[::Java/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/th | • {{#if: UbuntuHelp:Java|ไทย| [[::Java/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/tr | • {{#if: UbuntuHelp:Java|Türkçe| [[::Java/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/vi | • {{#if: UbuntuHelp:Java|Tiếng Việt| [[::Java/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/yue | • {{#if: UbuntuHelp:Java|粵語| [[::Java/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/zh | • {{#if: UbuntuHelp:Java|中文| [[::Java/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/zh-hans | • {{#if: UbuntuHelp:Java|中文(简体)| [[::Java/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Java | UbuntuHelp:Java | {{#if: | :}}Java}}/zh-hant | • {{#if: UbuntuHelp:Java|中文(繁體)| [[::Java/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:Java|:Java|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :Java/zh | | {{#ifexist: Java/zh | | {{#ifeq: {{#titleparts:Java|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Java|1|-1|}} | zh | | }}
Please do not make any edits to this article. Its contents are currently under review and being merged with the Ubuntu Server Guide. To find the Ubuntu Server Guide related to your specific version, please go to: https://help.ubuntu.com/ and click on Ubuntu Server Guide Sun Microsystems developed Java, which is many things depending on who you ask. It is a language, and an execution environment and probably many more things. On this page Java refers to the software that executes programs compiled to Java byte codes (akin to machine language).
Running Java under Ubuntu
In order to run Java programs, you must have a Java run time environment (JRE) installed. To run Java web applets in your browser, you additionally need a plugin for your browser, which is not installed by default. To use Java Web Start applications, no browser plugin is necessary. The default flavor of JRE installed is defined by the package default-jre. Currently, it is openjdk-6-jre, which is mostly derived from the Sun JRE.
To run Java applets using the plugin corresponding to OpenJDK, you must install the package icedtea6-plugin
.
Some Java applications may experience problems or worse problems under other JREs. Trial may be necessary.
JavaInstallation describes how to install some open source flavors of Java.
To get Sun closed source Java under Ubuntu 7.04 or later running on Intel or PowerPC platform, enable the Universe repository in Add/Remove programs, and install the sun-java6-jre
and sun-java6-plugin
packages.
For applet support in the browser, install sun-java6-plugin
as well (Warning: PowerPC version is slow, Warning: sun-java6 incorrectly sizes fonts in the GTK Look And Feel).
Note: The same commands will work under Xubuntu/Kubuntu (using Add/Remove or the Adept Package Installer).
Choosing the default Java to use
Just installing new Java flavours does not change the default Java pointed to by /usr/bin/java. You must explicitly set this:
- Open a Terminal window
- Run
sudo update-java-alternatives -l
to see the current configuration and possibilities. - Run
sudo update-java-alternatives -s XXXX
to set the XXX java version as default. For Sun Java 6 this would besudo update-java-alternatives -s java-6-sun
- Run
java -version
to ensure that the correct version is being called.
You can also use the following command to interactively make the change;
- Open a Terminal window
- Run
sudo update-alternatives --config java
- Follow the onscreen prompt