Kelly—

 

How much of this blog post is still true?

 

Ted Neward

Java, .NET, XML Services

Consulting, Teaching, Speaking, Writing

HYPERLINK "http://www.tedneward.com"http://www.tedneward.com

 

Feed: Kelly O'Hair's Blog
Posted on: Friday, December 15, 2006 11:04 AM
Author: kellyohair
Subject: JDK6 Build Cheat Sheet

 


JDK6 Build Cheat Sheet Just thought I'd list a few ways that the JDK can be 
built. These apply to JDK6 and JDK7, JDK5 building is a little different but 
has some of the same settings. The gnumake used...


HYPERLINK 
"http://weblogs.java.net/blog/kellyohair/archive/2006/12/jdk6_build_chea.html"View
 article...

 

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.17.9/1197 - Release Date: 12/25/2007 
8:04 PM


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.17.13/1208 - Release Date: 1/3/2008 3:52 
PM
 
  
Title: Kelly O'Hair's Blog: JDK6 Build Cheat Sheet
The Source for Java Technology Collaboration
User: Password:



Kelly O'Hair

Kelly O'Hair's Blog

JDK6 Build Cheat Sheet

Posted by kellyohair on December 15, 2006 at 11:04 AM | Comments (2)

JDK6 Build Cheat Sheet

Just thought I'd list a few ways that the JDK can be built. These apply to JDK6 and JDK7, JDK5 building is a little different but has some of the same settings. The gnumake used here is the GNU make 3.78.1 or newer.

  • On Solaris systems with the Companion CD installed, it can usually be found with the name gmake in /usr/sfw/bin/ or /opt/sfw/bin/.
  • On Linux just use make from /usr/bin/
  • On Windows and using CYGWIN, just use make from CYGWIN's /usr/bin/ (but make sure it's not 3.81, which seems to have taken away the ability to use paths with the ':' character, like C:/anything.)
  • On Windows with MKS, you will need a GNU make built for MKS.

See the JDK build instructions for more information.
NOTE: Any variables described below that start with ALT_ can be set on the gnumake command line, or be set in your environment. None of the Makefiles should be setting these variables internally, so no internal make variable setting should change your environment variable setting of them. The command line variable settings will override any setting inside the Makefiles.

Control Builds

>From the control/make/Makefile:

  • Build everything for a developer:

    gnumake dev
    OR
    gnumake DEV_ONLY=true

  • Skip the fastdebug build (just builds the product bits):

    gnumake SKIP_FASTDEBUG_BUILD=true DEV_ONLY=true

  • Don't build the fastdebug bits, and skip the hotspot and deploy areas:

    gnumake BUILD_HOTSPOT=false BUILD_DEPLOY=false ALT_JDK_IMPORT=/jdk1.6.0 SKIP_FASTDEBUG_BUILD=true DEV_ONLY=true

  • Build just the j2se debug image:

    gnumake BUILD_HOTSPOT=false BUILD_DEPLOY=false ALT_JDK_IMPORT=/jdk1.6.0 SKIP_FASTDEBUG_BUILD=true SKIP_DEBUG_BUILD=false DEV_ONLY=true debug_build

Here is a short list of the make variables that can be set on the gnumake command line:

  • BUILD_HOTSPOT

    Set to false to avoid building the hotspot VM, but you will need to also set ALT_JDK_IMPORT_PATH to a built jdk product of the same version you are building. I recommend setting this to false all the time, unless you are changing the hotspot VM.

  • BUILD_DEPLOY

    Set to false to avoid building javaws or the plugins. I recommend setting this to false all the time.

  • BUILD_INSTALL

    Set to false to avoid building install bundles (you should never need to do this). I recommend setting this to false all the time.

  • BUILD_J2SE

    Set to false to avoid the core j2se, which is unlikely you'd want to do this. I'd leave this one alone, unless you are only working on the hotspot VM.

  • BUILD_MOTIF

    Set to false to avoid building the Motif libraries, but you would need to then set ALT_MOTIF_DIR to where to get the built Motif libraries. This doesn't take long to build so I have never played with this, and I'm not even sure it's necessary

  • NO_DOCS

    Set to true to avoid any javadoc generation.

  • NO_IMAGES

    Set to true to avoid any images generation. This means the creation of the more formal JDK install-like image with the rt.jar and tools.jar files. When the images are not built, the JDK is left in the OUTPUTDIR area as a simple set of bin, lib, include, and classes directories. Which can be run as-is, but do not represent the form that a JDK install image will take. The creation of the images is mostly a disk movement activity, and on some machines this is very fast, and with others it can be slow.

  • SKIP_FASTDEBUG_BUILD

    Set to true to skip building any fastdebug bits (a set of -g -O built images with full runtime assert checking enabled).

  • SKIP_DEBUG_BUILD

    Set to false to build the debug images (-g with full runtime assert checking).

  • DEV_ONLY

    Set to true to get the settings: SKIP_COMPARE_IMAGES=true BUILD_INSTALL=false NO_DOCS=true.

  • SKIP_COMPARE_IMAGES

    Set to true to avoid a comparison of previous release build bundles with the ones you have created. You normally won't want this, so always set this to true.

  • ALT_OUTPUTDIR

    Alternative output directory rather than control/build. I recommend that the sources and this output directory be on your build machines local disk, for best build time performance.

  • ALT_BOOTDIR

    Alternative location for a bootstrap JDK, or install image of the previously released JDK (e.g. jdk1.5.0 for building jdk1.6.0). You really should set this all the time, just to make sure you get a local disk copy, for best build time performance. In theory, this doesn't have to be jak1.5.0, but could be a newer JDK, even the same version being built. But normally it's the previously release JDK.

  • ALT_JDK_IMPORT_PATH

    Alternative location for a JDK build of the same release as what you are building. If you skip building some components, the Makefiles will try and copy over the pre-built bits from this location, e.g. if you use BUILD_HOTSPOT=false (or don't have a hotspot directory), then the hotspot built images will be copied from this location.

Also try running gnumake help for more help on building options.

J2SE Builds

If you only want to work with the j2se and not the VM, you might consider just going into the j2se/make directory and running gnumake from there. Just run gnumake help for some help.

I'd recommend setting ALT_BOOTDIR and ALT_JDK_IMPORT_DIR (as described above).

Hotspot Builds

If you only want to work with the hotspot and not the VM, you might consider just going into the hotspot/make directory and running gnumake from there. Just run gnumake help for some help.

I'd recommend setting ALT_BOOTDIR and ALT_JDK_IMPORT_DIR (as described above).

Traditionally the hotspot build procedure have differed greatly from the rest of the JDK. This is mostly due to the fact that for the most part, it's more like building a large C++ library rather than anything else. Building each of the platforms was slightly different, for example on Windows the tool NMAKE.EXE was used instead of gnumake. It's the Makefiles and build scripts in the hotspot/build directory that contain the "real" hotspot build procedures. In JDK6 a gnumake Makefile was added at hotspot/make/Makefile which will use the Makefiles in the hotspot/build area, providing you a more generic hotspot building experience. More experienced hotspot builders may prefer to dive into the hotspot/build area.

Summary

So as you can see, some similarities, some differences between these build rules.

Hope this was helpful, if you have more questions please post comments.

-kto


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • Thank you, Kelly, the write up is nice. I was wondering if there is a way to build the vm with just the interpreter, as I assume that's what you'd do when you start porting it. ---
    You will need to talk to the HotSpot team about this, try sending email to one of the aliases documented at: https://openjdk.dev.java.net/hotspot/.
    -kto

    Posted by: robilad on December 15, 2006 at 09:00 PM

  • Very nice! ALT_MOTIF_DIR was created so static/and or different builds of motif could be used. Motif used to cause a lot of problems on platforms such as ppc etc. We (even before blackdown.org) added motif patches for the jdk so needed our own libraries. ALT_MOTIF_DIR didn't need to be set in the past, it was just an easy method to use different libraries if needed :-) (Just for historical sake)... It was also a bit hard to follow the logic of the thing (how ALT_MOTIF_DIR worked).
    I have found that figuring out the ALT_MOTIF_DIR layout was bizarre too. Hopefully, someday, we can just use the shared library versions on the system. I am not a fan of using static libraries, unless there is a critical reason for it.
    -kto

    Posted by: scotthutinger on December 18, 2006 at 02:25 PM



Only logged in users may post comments. Login Here.

Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds

Reply via email to