Rajendra's Blog
Tuesday May 06, 2008
Building OpenJDK in Ubuntu 8.04
I tried building OpenJDK in Ubuntu 8.04 on x86 machine. I have come across with some issues which have work-around. After installing all the necessary applications for building JDK and setting environment, building failed with the following error.
<error>
/home/rajendra/jdk7/jdk7/hotspot/src/os/linux/vm/jvm_linux.cpp:179:
warning: deprecated conversion from string constant to ‘char*’
make[5]: *** [jvm_linux.o] Error 1
make[5]: Leaving directory
`/home/rajendra/jdk7/jdk7/build/hotspot/outputdir/linux_i486_compiler2/product'
make[4]: *** [the_vm] Error 2
</error>
It seems new compilers enables -Write-strings by default, work-around for this issue is to hack the make file hotspot/build/linux/makefiles/gcc.make and add the flag 'CFLAGS += -Wno-write-strings'. This solves the gcc failure.
After adding the flag build continued for some time and crashed with the following error.
Alan bateman has given work-around for this issue which worked for me. Alan suggested me to switch to bash or delete the /bin/sh and create a link "ln -s bash sh". I am happy this work-around solved my issue. After few minutes building again failed with the following error.<error> /home/rajendra/jdk7/jdk7/build /gensrc/java/nio/charset/CharsetEncoder.java:142: cannot find symbol symbol : class $replType$ location: class java.nio.charset.CharsetEncoder private $replType$ replacement; </error>
<error> /usr/bin/ld: cannot find -lXtst collect2: ld returned 1 exit status make[3]: *** [/home/rajendra/jdk7/jdk7/build/lib/i386/xawt/libmawt.so] Error 1 make[3]: Leaving directory `/home/rajendra/jdk7/jdk7/jdk/make/sun/xawt' make[2]: *** [all] Error </error>
For which I don't know the solution. If you have work-around or solution for the above issue please let me know.
Posted at 02:41PM May 06, 2008 by Rajendra Gutupalli in Sun | Comments[3]
you need to install libxtst-dev and maybe libxtst6
Posted by Leonel on May 06, 2008 at 05:29 PM IST #
Thanks Leonel, Yes I forgot to install xlibs-dev packages. Synaptic package manager has not listed this package when I searched for the same. So I thought I would install it later and forgot finally. Just now I completed building the OpenJDK source in Ubuntu 8.04.
Posted by Rajendra on May 07, 2008 at 12:42 PM IST #
This was very helpful for me. Thank you.
Posted by 69.15.97.189 on May 27, 2008 at 11:28 PM IST #