(updated the faq and removed all obsolete info) |
|||
Line 7: | Line 7: | ||
=== What is the Java environment in Fedora? === | === What is the Java environment in Fedora? === | ||
[http://openjdk.java.net OpenJDK | [http://openjdk.java.net OpenJDK] is the default Java environment since Fedora 17. It is Oracle(formerly Sun) Java under a free and open source license, and there are runtime and development packages. | ||
=== I didn't get Java at install time, but I want to install it now. How do I do that? === | === I didn't get Java at install time, but I want to install it now. How do I do that? === | ||
The OpenJDK runtime and development packages are installed by default during any large-media install, such as from the Fedora DVD. | |||
If installing from a live image, such as a live CD or USB flash drive, add the OpenJDK 7 runtime after the install: | If installing from a live image, such as a live CD or USB flash drive, add the OpenJDK 7 runtime after the install: | ||
* | * Use the software center and use search to find the package(s) to install. | ||
* To install from the command line: | * To install from the command line: | ||
<pre> | <pre> | ||
su -c "yum install java-1. | su -c "yum install java-1.?.0-openjdk" | ||
</pre> | </pre> | ||
This package contains just the Java Runtime Environment. To develop Java programs, install the <code>java-1. | This package contains just the Java Runtime Environment. To develop Java programs, install the <code>java-1.?.0-openjdk-devel</code> package. Install all the OpenJDK packages, including the API documentation, by using the wildcard <code>java-1.?.0-openjdk*</code>. | ||
Refer to the [http://docs.fedoraproject.org/yum/ Software Management Guide] for more information. | Refer to the [http://docs.fedoraproject.org/yum/ Software Management Guide] for more information. | ||
Line 55: | Line 38: | ||
Java packages in Fedora are in the main based on and compatible with those of the [http://www.jpackage.org/ JPackage Project] . Their packaging infrastructure and policy documentation is included in full in the jpackage-utils package. The main things you probably want to know, however, are that the commands (<code>java</code>, <code>javac</code>, <code>jar</code>, etc) are on the system path, the main jar repository is <code>/usr/share/java</code> and the extensions jar repository is <code>/usr/share/java-ext</code> | Java packages in Fedora are in the main based on and compatible with those of the [http://www.jpackage.org/ JPackage Project] . Their packaging infrastructure and policy documentation is included in full in the jpackage-utils package. The main things you probably want to know, however, are that the commands (<code>java</code>, <code>javac</code>, <code>jar</code>, etc) are on the system path, the main jar repository is <code>/usr/share/java</code> and the extensions jar repository is <code>/usr/share/java-ext</code> | ||
=== What about running Java applets in the browser? === | === What about running Java applets in the browser? === | ||
<pre> | <pre> | ||
Line 89: | Line 48: | ||
Hack on the JDK itself, right here in the growing OpenJDK Community: Browse the code on the web, get a source bundle or clone a Mercurial repository to make a local copy, learn how to build and hack on the code with the NetBeans IDE, and [http://openjdk.java.net/contribute/ contribute a patch to fix a bug], enhance an existing component, or define a new feature. | Hack on the JDK itself, right here in the growing OpenJDK Community: Browse the code on the web, get a source bundle or clone a Mercurial repository to make a local copy, learn how to build and hack on the code with the NetBeans IDE, and [http://openjdk.java.net/contribute/ contribute a patch to fix a bug], enhance an existing component, or define a new feature. | ||
=== How do I get stack traces from Java programs when filing a bug report? === | === How do I get stack traces from Java programs when filing a bug report? === | ||
Line 131: | Line 74: | ||
= See Also = | = See Also = | ||
* [[Java]] | * [[Java]] | ||
[[Category:Java]] | [[Category:Java]] |
Revision as of 15:22, 19 May 2014
Java FAQ
Questions about the Java environment running on Fedora.
General
What is the Java environment in Fedora?
OpenJDK is the default Java environment since Fedora 17. It is Oracle(formerly Sun) Java under a free and open source license, and there are runtime and development packages.
I didn't get Java at install time, but I want to install it now. How do I do that?
The OpenJDK runtime and development packages are installed by default during any large-media install, such as from the Fedora DVD.
If installing from a live image, such as a live CD or USB flash drive, add the OpenJDK 7 runtime after the install:
- Use the software center and use search to find the package(s) to install.
- To install from the command line:
su -c "yum install java-1.?.0-openjdk"
This package contains just the Java Runtime Environment. To develop Java programs, install the java-1.?.0-openjdk-devel
package. Install all the OpenJDK packages, including the API documentation, by using the wildcard java-1.?.0-openjdk*
.
Refer to the Software Management Guide for more information.
Fedora's Java environment does not provide the functionality I require. Can I install another?
The JPackage Project has packages for a variety of Java environments, both free and proprietary. These packages are designed so that more than one may be installed simultaneously. The Java environment in Fedora is fully compatible with this system.
Installing a JPackage Java environment is described in detail in JpackageJava .
Java environments other than from JPackage are likely to interfere with Fedora's Java environment and their use is not recommended.
Usage
Where is everything?
Java packages in Fedora are in the main based on and compatible with those of the JPackage Project . Their packaging infrastructure and policy documentation is included in full in the jpackage-utils package. The main things you probably want to know, however, are that the commands (java
, javac
, jar
, etc) are on the system path, the main jar repository is /usr/share/java
and the extensions jar repository is /usr/share/java-ext
What about running Java applets in the browser?
su -c "yum install icedtea-web"
How can I assist the development of OpenJDK
Hack on the JDK itself, right here in the growing OpenJDK Community: Browse the code on the web, get a source bundle or clone a Mercurial repository to make a local copy, learn how to build and hack on the code with the NetBeans IDE, and contribute a patch to fix a bug, enhance an existing component, or define a new feature.
How do I get stack traces from Java programs when filing a bug report?
See JavaStackTraces
Why are my executable JAR files opened instead of being executed?
The default action for .jar
files is to treat them as ordinary .zip
files. Two ways to fix this:
- Register a binfmt for .jar (see /usr/share/doc/kernel-doc-*/Documentation/java.txt for details)
- Change the default action in nautilus, or whatever file manager you use. In nautilus, I think you can do this by: right-click on the
.jar
file, chooseProperties
, chooseOpen With
, clickAdd
, clickUse a custom command
, and type inxterm -e java -jar
Can I run Oracle Java on Fedora?
You sure can, however, we recommend you to try OpenJDK first and switch to Oracle Java only if you experience problems with the OpenJDK.
Oracle Java can be downloaded from here as an RPM package. You can use afterwards the alternatives
program to toggle
between different Java runtime environments, compilers, etc.