Rajendra's Blog

Wednesday May 07, 2008

Building OpenJDK with New NIO.2 patch

Source code for NIO.2 is available as a patch. I have applied the NIO.2 patch to the clone of OpenJDK repository and built the OpenJDK source in Solaris-Sparc and Ubuntu 8.04 on x86 machine.

Here are the steps I have followed.

> Install Mercurial 0.9.5 and update hg configuration file ~/.hgrc with forest extension.
> To install forest extension to mercurial

                 > export http_poxy=your proxy
                 > hg clone http://hg.akoha.org/hgforest
set the forest configuration variable to the path of forest.py in extensions section of ~/.hgrc file to enable forest extension
                  [extensions]
                  forest=/home/rajendra/hgforest/forest.py
>clone the jdk7 mercurial repository
                  hg fclone http://hg.openjdk.java.net/jdk7/tl jdk7

> download nio2-b90 patch
> move to folder jdk7/jdk and apply the nio patch with following command
                    patch -p1 < nio2-b90.patch
> follow the instructions for building OpenJDK
Here I executed the sample code DiskUsage.java which exhibits as df utility with the new build as follows.
$ ~/jdk7/build/bin/java -version 
openjdk version "1.7.0-internal"
OpenJDK Runtime Environment (build 1.7.0-internal-b27)
OpenJDK Client VM (build 12.0-b01, mixed mode)
$~/jdk7/mytl/build/bin/java DiskUsage

Filesystem                 kbytes         used        avail
/ (/dev/sda1)           113313700      5238532    102364464
/proc (proc)                    0            0            0
(output discarded)

Try yourself and send feed-back, comments and suggestions to NIO OpenJDK project. I hope you will enjoy.

Comments:

How about compiling in other OS like CentOS 5.x & Windows Vista?

Uday.

Posted by Uday on May 13, 2008 at 03:09 AM IST #

Hi,

I am trying to build it following your instructions.
clone, patch works file, but compiling jvm failed with error:
src/os/linux/vm/jvm_linux.cpp
cc1plus: warnings being treated as errors
/home/tigran/fix/jdk7/jdk7/hotspot/src/os/linux/vm/jvm_linux.cpp:179: warning: deprecated conversion from string constant to ‘char*’
...
make[5]: *** [jvm_linux.o] Error 1
..

My environment:

tigran@nairi:~> uname -a
Linux nairi 2.6.22.17-0.1-default #1 SMP 2008/02/10 20:01:04 UTC i686 i686 i386 GNU/Linux
tigran@nairi:~> make --version
GNU Make 3.81

tigran@nairi:~> gcc --version
gcc (GCC) 4.2.1 (SUSE Linux)

tigran@nairi:~> ant -v
Apache Ant version 1.7.0 compiled on December 13 2006

Thanks,
Tigran.

Posted by Tigran Mkrtchyan on June 18, 2008 at 02:26 PM IST #

Please see my post http://blogs.sun.com/rajendrag/entry/building_openjdk_in_ubuntu_8
I have mentioned about this issue.

Posted by 192.18.43.225 on June 20, 2008 at 01:25 PM IST #

It was a very nice idea! Just wanna say thank you for the information you have shared. Just continue writing this kind of post. I will be your loyal reader. Thanks again.

Posted by Christian Louboutin Boots on October 29, 2009 at 10:21 AM IST #

It was a very nice idea! Just wanna say thank you for the information you have shared. Just continue writing this kind of post. I will be your loyal reader. Thanks again.

Posted by Abercrombie clothes on November 08, 2009 at 01:58 PM IST #

Post a Comment:
  • HTML Syntax: NOT allowed

Calendar

Feeds

Search

Links

Navigation

Referrers