# OpenJDK compile error



## jonfr (Jul 3, 2013)

For some reason openJDK fails to compile with this error.


```
mkdir -p /usr/ports/java/openjdk6/work/build/bsd-amd64/hotspot/outputdir
cd /usr/ports/java/openjdk6/work/build/bsd-amd64/hotspot/outputdir; \
    gmake -f /usr/ports/java/openjdk6/work/hotspot/make/bsd/Makefile \
               LP64=1 JAVA_HOME=/usr/local/bootstrap-openjdk OUTPUTDIR=/usr/ports/java/openjdk6/work/build/bsd-amd64/hotspot/outputdir GAMMADIR=/usr/ports/java/openjdk6/work/hotspot MAKE_VERBOSE=y HOTSPOT_RELEASE_VERSION=20.0-b12 JRE_RELEASE_VERSION=1.6.0_32-b27 HOTSPOT_BUILD_VERSION= product
gmake[4]: Entering directory `/usr/ports/java/openjdk6/work/build/bsd-amd64/hotspot/outputdir'
cd bsd_amd64_compiler2/product && gmake -w " LP64=1 "
gmake[5]: Entering directory `/usr/ports/java/openjdk6/work/build/bsd-amd64/hotspot/outputdir/bsd_amd64_compiler2/product'
gmake[6]: Entering directory `/usr/ports/java/openjdk6/work/build/bsd-amd64/hotspot/outputdir/bsd_amd64_compiler2/product'
gmake[6]: *** No rule to make target `/usr/ports/java/openjdk6/work/hotspot/src/cpu/amd64/vm/x86_64.ad', needed by `../generated/adfiles/bsd_x86_64.ad'.  Stop.
gmake[6]: Leaving directory `/usr/ports/java/openjdk6/work/build/bsd-amd64/hotspot/outputdir/bsd_amd64_compiler2/product'
gmake[5]: *** [ad_stuff] Error 2
gmake[5]: Leaving directory `/usr/ports/java/openjdk6/work/build/bsd-amd64/hotspot/outputdir/bsd_amd64_compiler2/product'
gmake[4]: *** [product] Error 2
gmake[4]: Leaving directory `/usr/ports/java/openjdk6/work/build/bsd-amd64/hotspot/outputdir'
gmake[3]: *** [generic_build2] Error 2
gmake[3]: Leaving directory `/usr/ports/java/openjdk6/work/hotspot/make'
gmake[2]: *** [product] Error 2
gmake[2]: Leaving directory `/usr/ports/java/openjdk6/work/hotspot/make'
gmake[1]: *** [hotspot-build] Error 2
gmake[1]: Leaving directory `/usr/ports/java/openjdk6/work'
gmake: *** [build_product_image] Error 2
*** [do-build] Error code 1

Stop in /usr/ports/java/openjdk6.
*** [install] Error code 1

Stop in /usr/ports/java/openjdk6.
*** [reinstall] Error code 1

Stop in /usr/ports/java/openjdk6.
*** [build-depends] Error code 1

Stop in /usr/ports/print/pdflib.
*** [install] Error code 1

Stop in /usr/ports/print/pdflib.
*** [reinstall] Error code 1

Stop in /usr/ports/print/pdflib.
*** [lib-depends] Error code 1

Stop in /usr/ports/print/pecl-pdflib.
*** [reinstall] Error code 1

Stop in /usr/ports/print/pecl-pdflib.
*** [build-depends] Error code 1

Stop in /usr/ports/lang/php55-extensions.
*** [install] Error code 1

Stop in /usr/ports/lang/php55-extensions.
*** [reinstall] Error code 1
```

For the time being. I am going to disable java in pdflib.


----------



## jozze (Jul 3, 2013)

Well first of all make sure your ports tree is up to date (`# portsnap fetch update` or `#" svn up /usr/ports`) and then try `# portupgrade -Rf openjdk6` or `# portmaster -Rf openjdk6`.

I had a very weird problem with java/openjdk6 myself a month or two ago.The solution was to completely deinstall it, and then install it. So a mere `# make -C /usr/ports/java/openjdk6 reinstall` didn't do, I had to delete it first. Now, you may be worried about what would happen if you deleted it, and still couldn't reinstall it. For this reason you can create a simple chroot(8)() environment, or a jail(8)(), and test if this would help.


----------



## jonfr (Jul 5, 2013)

This is a fresh install of FreeBSD-9.1 64-bit. So this should not have happened, unless there is a bug in openjdk6.


----------



## ShelLuser (Jul 5, 2013)

Could you run a `# make showconfig` and paste the output here?

Because on my end everything compiles without problems (while only using IPv6 and TZUpdate), so it seems to be option specific.


----------



## jonfr (Jul 5, 2013)

This is what `# make showconfig` gives me.


```
root@saturn:/usr/ports/java/openjdk6 # make showconfig
===> The following configuration options are available for openjdk6-b27_3:
     DEBUG=off: Enable legacy debugging support
     FASTDEBUG=off: Include fastdebug build
     ICEDTEA=on: Apply additional patches from IcedTea
     IPV6=on: IPv6 protocol support
     POLICY=off: Install the Unlimited Strength Policy Files
     SOUND=on: Enable sound support
     TEST=off: Add support for running regression test
     TZUPDATE=on: Update the time zone data
===> Use 'make config' to modify these settings
```


----------



## EW1 (Jul 5, 2013)

Did the bootstrap package (bootstrap-openjdk-r316538) build and install correctly?

(I just built the same ports from a fresh `portsnap extract` earlier today on the same platform with no errors in the openjdk6 port.)


----------



## ShelLuser (Jul 6, 2013)

Quite a bizarre error message. In the mean time I tried building OpenJDK6 myself with the options you mentioned above, and although it took its sweet time it builds without any errors.

Therefore I'm now tempted to blame something in your environment for causing this odd behaviour. So, just to try and narrow things down could you show us the contents of /etc/make.conf?

Looking some more into this port (I consider this to be a fascinating port, but then again I really like the Java language) I also noticed that it has quite some build dependencies (ports which it requires to actually build the software):


```
root@smtp2:/usr/ports/java/openjdk6 # make build-depends-list
/usr/ports/archivers/unzip
/usr/ports/archivers/zip
/usr/ports/devel/gmake
/usr/ports/print/cups-client
/usr/ports/print/freetype2
/usr/ports/x11-toolkits/libXt
/usr/ports/x11-toolkits/open-motif
/usr/ports/x11/libX11
/usr/ports/x11/libXext
/usr/ports/x11/libXi
/usr/ports/x11/libXpm
/usr/ports/x11/libXtst
```
Although I have no reason to suspect that this could be of any influence (your make.conf is a more liable source) I can't help wonder if it couldn't be of any influence.

So if you have the time and want to look into this I'd like to suggest that you "start over". Run `# make distclean` from the java/openjdk6 ports directory, then use something like `# portmaster -f java/openjdk6`.

Actually, I suggest using this command instead: `# script /root/build.log portmaster -f java/openjdk6`.

This will rebuild OpenJDK6 (and install it when everything works out) as well as rebuild all the ports it depends on. On top of that it will log everything which is transpiring (including any key presses you make) in the /root/build.log file. And that can come in handy with trying to solve this mystery.

It can take a while to build, but it should give us more clues as to what is going on.


----------

