My name is Deniz, and I work in Opera QA, Systems and Processes on tools development. We mainly create tools for automation, stress testing, and various other stuff. In this first post, I will try to guide you on building the OpenJDK platform, in upcoming posts I will give samples on how to use it.
Here at QA SaP, we try to keep up with the latest technologies, and Java is no exception. After the announcement of NIO2, I had my eyes on ea(early access) builds to test the new APIs to see if it would solve my long-lasting issues with NIO.
So, what is NIO2 and why is it useful? NIO APIs in Java, compared to old regular IO, provides features for intensive I/O operations. For example, we have used NIO with our proprietary stress tester tool—which would not be possible to implement in standard IO, and it proved to be very useful. However, we had some problems with it in terms of scalability and maintenance and those were targeted by Sun in NIO2. Moreover, they introduced a bunch of new File IO APIs—such as New File System API, useful for creating a wide range of tools with ease.
Finally, Sun released the implementation—first with a patch; later it was merged to repository (mercury/hg), but they had no binary builds available.
So, I wanted to compile the source code —after they released it as a patch. However, it wasn't as easy at it may sound hence the reason for this tutorial. Luckily, Sun started providing the binaries for all platforms some time ago, but we think it is a good idea to be on the bleeding edge and to be able to build the jdk7 on your own.
I would like to mention that this tutorial is based on Rajendra's post—which really helped me a lot during the build—and Elliotte's post on java.net. I thought it would be helpful to have everything in one place, providing links to downloads, listing packages, and so forth. I tried to combine both posts, clean the obsolete packages, and provide links to files, which should speed up the process for you.
The building platform is Ubuntu 8.04 i586/x64 (I am on x64), which is up to date as of writing this post. I tried to put all Java-related files to /opt/java; by just changing the directories (/opt/java and /home/operaqa), you should have no problems compiling.