# :( Building jdk from ports



## gilnovjetlui (Nov 21, 2012)

The problem while building jdk from ports never seems to stop. Someplaces licensing restrictions require to fetch manually, and when you install manually then there is version incompatibility  error message while build. And I have tried all, jdk, openjdk, diablo. Has anyone recently installed jdk? Any guidance? I really have lost lot of time here. And since I have to really squeeze time to fiddle with my new FreeBSD 9 and bringing it to a friendly state as desktop.


----------



## fonz (Nov 21, 2012)

Installing Java (JDK and/or JRE) on FreeBSD has long been a bit of a pain in the arse, but so far it has always worked for me after a bit of a faff. Can you be more precise about exactly what you did and exactly what went wrong?


----------



## kpa (Nov 21, 2012)

I recently built java/openjdk6 on my amd64 system without issues. It does take quite a bit of disk space and time tough.


----------



## gilnovjetlui (Nov 21, 2012)

When
Trying to build openjdk6.
Below I have pasted part of the log. For full log (visit: http://pastebin.com/5w12rVgx  )


```
===>  Building for openjdk6-b24
.......
WARNING: Your build environment has the variable NO_DOCS\n         defined. This will result in a development-only\n         build of the JDK, lacking the documentation\n         build.\n 
Sanity check passed.
Control bsd i586 1.6.0 all_product_build build started: 12-11-21 02:51
Control bsd i586 1.6.0 build_product_image build started: 12-11-21 02:51
gmake \
        SKIP_FASTDEBUG_BUILD=true \
        SKIP_DEBUG_BUILD=true \
         \
        generic_build_repo_series
gmake[1]: Entering directory `/usr/ports/java/openjdk6/work'
/bin/mkdir -p ./build/bsd-i586
/bin/mkdir -p ./build/bsd-i586/j2sdk-image
/bin/mkdir -p /usr/ports/java/openjdk6/work/build/bsd-i586/langtools
(cd  ./langtools/make && \
......
gmake[2]: Entering directory `/usr/ports/java/openjdk6/work/langtools/make'
JAVA_HOME=/usr/local/diablo-jdk1.6.0 ANT_OPTS=-Djava.io.tmpdir='/usr/ports/java/openjdk6/work/build/bsd-i586/langtools/build/ant-tmp' /usr/ports/java/openjdk6/work/apache-ant-1.8.2/bin/ant -Djdk.version=1.6.0 -Dfull.version='1.6.0-b24'  -Drelease=1.6.0 -Dbuild.number=b24 -Djavac.target=5 -Dboot.java.home=/usr/local/diablo-jdk1.6.0 -Dbuild.dir=/usr/ports/java/openjdk6/work/build/bsd-i586/langtools/build -Ddist.dir=/usr/ports/java/openjdk6/work/build/bsd-i586/langtools/dist build
Error occurred during initialization of VM
Unable to load ZIP library: /usr/local/diablo-jdk1.6.0/jre/lib/i386/libzip.so
gmake[2]: Leaving directory `/usr/ports/java/openjdk6/work/langtools/make'
gmake[1]: Leaving directory `/usr/ports/java/openjdk6/work'
*** Error code 1

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

Stop in /usr/ports/java/openjdk6.
//////////
When trying openjdk7
///////////////////////////////
===>  Building for openjdk-7.0.147_1
*** Error code 1

Stop in /usr/ports/java/openjdk7.

ERROR:OUTPUTDIR '.build/bsd-i586 not created or not writable". Stop
/////////////////////////////////////////////////////////////////////////
 (I do not know why is it trying to create i586 here... i386 should work for me)

When trying to build diablo
////////////////////////
===>  Vulnerability check disabled, database not found
===>  License check disabled, port has not defined LICENSE
===>  Found saved configuration for diablo-jdk-1.6.0.07.02_17

 Because of licensing restrictions, you must fetch the distribution
 manually.

 Please access

     [url]http://www.FreeBSDFoundation.org/cgi-bin/download?download=diablo-caffe-freebsd7-i386-1.6.0_07-b02.tar.bz2[/url]

 with a web browser and "Accept" the End User License Agreement for
 "Caffe Diablo 1.6.0".

 Please open [url]http://www.oracle.com/technetwork/java/javase/downloads/index.html[/url]
 in a web browser and follow the "Download" link for
 "JDK DST Timezone Update Tool - 1_3_42" to obtain the
 time zone update file, tzupdater-1_3_42-2011k.zip.

 Please place the downloaded file(s) in /usr/ports/distfiles.

*** Error code 1

Stop in /usr/ports/java/diablo-jdk16.
*** Error code 1

Stop in /usr/ports/java/diablo-jdk16.
```


----------



## gilnovjetlui (Nov 21, 2012)

Any suggestions?


----------



## SirDice (Nov 21, 2012)

What's in /etc/make.conf?


----------



## fonz (Nov 21, 2012)

In the case of Diablo, simply do what it says:


			
				gilnovjetlui said:
			
		

> ```
> ===>  Vulnerability check disabled, database not found
> ===>  License check disabled, port has not defined LICENSE
> ===>  Found saved configuration for diablo-jdk-1.6.0.07.02_17
> ...


Granted, it's perhaps a bit clumsy. But it does (read: should) work. Make sure your ports tree is up to date, though.


----------



## gilnovjetlui (Nov 21, 2012)

my /etc/make.conf has


```
# added by use.perl 2012-11-15 13:01:54
PERL_VERSION=5.12.4
```


----------



## wblock@ (Nov 21, 2012)

gilnovjetlui: Please read http://forums.freebsd.org/showthread.php?t=8816 about formatting.  Using 
	
	



```
and other tags will make your posts easier to read.
```


----------

