help: configuration issues

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Wed Sep 13 09:49:45 UTC 2017



On 13/09/17 06:09, Razvan Minciuna wrote:
> Hi,
>
> I am trying to properly configure the development environment so I can test
> the amber project.
> This is my first experience with openjdk and I couldn´t find enough
> information to get it done.
> So, after downloading the lvti branch from the repository and put it into
> the Eclipse I don´t know where to go next.
>
> If you have any documentation so I can read in order to finish the process
> so I can start using and testing the repository please let me know.
> Thank you.
Hi Razvan,
So, first of all, you need to clone the repo (which you probably already 
have done - but I will repeat the step anyway):

$ hg clone http://hg.openjdk.java.net/amber/amber amber-dev

The above command will fetch the toplevel JDK repo and store it locally 
in the 'amber-dev' folder (you can change name of course if you want 
to). Note also that this will only fetch the 'toplevel' repo - JDK is 
currently organized as a 'forest' of repositories, so there's more than 
one you need to get - you can do so like this:

$ sh get_sources.sh

This will fetch the remaining repositories - as some of these are big, 
it might take a while. This second step is temporary, and will go away 
once the repositories will be consolidated (an ongoing effort, see [1]).

Now you should have a complete folder structure:

amber-dev
      jaxp
      jaxws
      langtools
      hotspot
      jdk
      corba
      nashorn
      make
      test
      common

So, since the amber repository is organized in branches, you need first 
to decide which branch you want to try out. Let's assume you want to try 
local variable type inference - the name of the branch is 'lvti' - so 
you need to update all JDK repositories to that branch, which you can do 
with this command:

$ sh common/bin/hgforest.sh update lvti

This will update the working version of all repositories to the latest 
'lvti' changeset. Note that the 'hgforest' command above is a little 
useful helper that allows you to run the same command on all the JDK 
repos in the forest - so, by running the above command is like going 
into every repo subfolder and running 'hg update lvti' by hand.

You can confirm that you have updated the repos to the right branch by 
doing the following:

$ hg common/bin/hgforest branch

This should print a list of lines such as

jdk: lvti
langtools: lvti
...

Which indicates the repos are indeed in the right branch.

Now it's time to build the JDK. To build, you first need to run the 
configuration step, which will test whether you have all the tools (such 
as GCC or Clang) and libraries (such as freetype) needed in order to 
build the JDK. You can do so as follows:

$ sh configure --with-boot-jdk=<PATH-TO-JDK-8>

The 'with-boot-jdk' parameter is very important - it's the JDK that is 
used to 'bootstrap' (e.g. to compile an initial version) of this JDK. It 
must point to an existing JDK 8 installation which you probably have 
somewhere in your machine. If not, go here [2] and fetch one.

The configure should generate loads of output, but no errors. If there's 
an error it typically means that one (or more) build dependencies were 
not satisfied, so you need to take care of that (if you are in a 
debian-based Linux, this is typically done by installing some missing 
libraries - usually achieved by running some 'apt' command).

After configure you are ready to go, really - so you can start the build:

$ make images

This will build the entire JDK and create an 'images' folder (under 
build/<arch>/images/jdk). Inside you will find a 'bin' folder containing 
all the usual commands (java, javac, javap, ...) which you can start 
using to try out local variable inference.

This should cover the basics of the process, I expect there will be one 
or two peculiarities in your env that will pop up at some point (esp. at 
the configure step) - if you get stuck please do not hesitate to come 
back here and ask for help. There's also a mailing list of build experts 
(build-dev @ o.j.n) in case things get nasty - but let's hope for the 
best :-)

Cheers
Maurizio

[1] - 
http://mail.openjdk.java.net/pipermail/jdk10-dev/2017-August/000451.html
[2] - 
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

> Regards,
> Razvan



More information about the amber-dev mailing list