How to compile OpenJDK on Ubuntu
2012-03-01 19:48
615 查看
How to compile OpenJDK on Ubuntu
http://www.vogella.de/articles/OpenJDK/article.html
Lars Vogel
Version 0.3Copyright © 2009 - 2010 Lars Vogel
30.11.2008
Revision History | ||
---|---|---|
Revision 0.1 | 30.08.2009 | Lars Vogel |
Created | ||
Revision 0.2 - 0.3 | 12.11.2009 - 25.07.2010 | Lars Vogel |
bug fixes and enhancements |
This article describes how to download the source code of OpenJDK and how to compile it. The platform which is used in Ubuntu.
Table of Contents
1. OpenJDK Overview2. Install Mercurial and Extensions3. Clone the OpenJDK repositories4. Compile OpenJDK5. Thank you6. Questions and Discussion7. Links and Literature
7.1. Source Code7.2. General
1. OpenJDK Overview
OpenJDK is the open source implementation of Java. OpenJDK is under version control by a distributed version control system called Mercurial .This guide will describe how to install Mercurial, download the source code of OpenJDK and how to compile OpenJDK.
2. Install Mercurial and Extensions
You first need to make sure Mercurial is installed on your system.sudo apt-get install mercurial
In addition to standard Mercurial you also need the Forest Extension. These are currently not packages for Ubuntu, see Bug
report
You can get the forest extension via the following command. This will create the directory hgforest with the file "forest.py".
# close the forest extensions # if the url below does not work you find alternative url via # http://bitbucket.org/repo/all?name=hgforest hg clone https://vogella@bitbucket.org/vogella/hgforest-crew
Edit the file "~/.hgrc" (i.e. the mercurial configuration file) to include the lines.
[extensions] forest=/home/vogella/hgforest/forest.py
After this change you should be able to use commands such as 'fclone' and 'fpull' is you type in "hg" in the command line.
Install the build dependencies via the following commands:
sudo aptitude build-dep openjdk-6 sudo aptitude install openjdk-6-jdk
3. Clone the OpenJDK repositories
Clone the OpenJDK7 respositories via the following command.hg fclone http://hg.openjdk.java.net/jdk7/jdk7
Alternatively you can clone OpenJDK6 via the following command.
hg fclone http://hg.openjdk.java.net/jdk6/jdk6
4. Compile OpenJDK
Switch into you OpenJDK directory and compile it via:#set a few environment variables for the build: export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk make ALLOW_DOWNLOADS=true
After a long time the compilation should be successful. The default output directory is build/platform, where platform your operating system. The build/platform/j2sdk-image/bin should contain executables for the OpenJDK tools. The "demo" dirctory contains
several demos which you can use to validate your build. Try "./java -version" in your "/build/platform/bin" and validate that you see the version of OpenJDK which you compiled against.
5. Thank you
Please help me to support this article:相关文章推荐
- How to install sun-java5-jdk on Ubuntu 10.04
- How to install the Sun Java JDK on Ubuntu 10.10
- How to Install Oracle Java JDK on Ubuntu Linux
- [置顶] How to compile openjdk 7 in RHEL5
- how to compile android2.3 on ubuntu14
- How to compile Android 2.3 on Ubuntu 10.04 32bit
- How to Install JAVA 8 (JDK 8u40) on Ubuntu & LinuxMint Via PPA
- how to install OpenFetion using source, not deb, on Ubuntu
- How to Install Oracle Java JDK on Ubuntu Linux
- How to install sun-java5-jdk on Ubuntu 9.10
- How to compile openjdk 7 in RHEL5
- How to Compile Android on Ubuntu (12.04)
- How to Install JAVA 8 (JDK 8u91) on Ubuntu & LinuxMint via PPA
- how to install the Oracle Java (JDK) 8, Oracle Java (JDK + JRE) 7 or Oracle Java (JDK) 6 on Ubuntu 1
- How to compile and debug VLC player source code in eclipse IDE on Ubuntu 10.04 (lucid)
- How to install jdk on Ubuntu
- How to Compile Android on Ubuntu (12.04)
- How to Compile Android on Ubuntu (12.04)
- How to compile/build QEMU 1.4.0 on Ubuntu 12.04