Building OpenJdk7 in Ubuntu14.10 ( amd64 )

Finally Result:

-- Build times ----------

Target debug_build
Start 2015-09-29 15:43:41
End   2015-09-29 15:57:11
00:01:23 corba
00:03:46 hotspot
00:00:23 jaxp
00:00:31 jaxws
00:06:59 jdk
00:00:28 langtools
00:13:30 TOTAL

-------------------------


1. Download the openjdk7 source code from http://download.java.net/openjdk/jdk7/


2. For building open jdk , need install the dependence sudo apt-get build-dep openjdk-7


3. Install Oracle JDK 6 .

if you install openjdk6 ,may suffer below issue:

Unable to load native library: ~/java/jopenjdk6/jre/lib/amd64/libjava.so: symbol JVM_SetNativeThreadName, version SUNWprivate_1.1 not defined in file libjvm.so with link time reference

could refer :http://blog.csdn.net/gobitan/article/details/24322561


4. Create a shell script in openjdk main folder :

<pre name="code" class="plain">#!/bin/bash
export LANG=C
export ARCH_DATA_MODEL=64
export DISABLE_HOTSPOT_OS_VERSION_CHECK=ok
export ALT_BOOTDIR=/usr/local/java/jdk1.6.0_45 jvmg
export ALLOW_DOWNLOADS=true
export USE_PRECOMPILED_HEADER=true
export SKIP_DEBUG_BUILD=false
export SKIP_FASTDEBUG_BUILD=true
export DEBUG_NAME=debug
unset CLASSPATH
unset JAVA_HOME
make sanity && make


 
 
5. Some Bug need to be fixed before your exec above script:

5.1

src/share/vm/runtime/interfaceSupport.hpp:430:0: error: "__LEAF" redefined [-Werror]

/usr/include/x86_64-linux-gnu/sys/cdefs.h:44:0: note: this is the location of the previous definition

ANS:Develop Team has fixed this bug , you could find the solution in below link from the Official Doc:

http://hg.openjdk.java.net/hsx/hsx23/hotspot/rev/a6eef545f1a2

5.2

Need Update "openjdk/jdk/make/javax/sound/jsoundalsa/Makefile,

Change=>

LDFLAGS += -lasound 

To=>

OTHER_LDLIBS += -lasound

5.3

Need Update hotspot/make/linux/Makefile

note below code:

#ifeq ($(DISABLE_HOTSPOT_OS_VERSION_CHECK)$(EMPTY_IF_NOT_SUPPORTED),)
#   $(QUIETLY) >&2 echo "*** This OS is not supported:" `uname -a`; exit 1;
#endif


6.May be you need to change the system environment from Chinese to English .



But when I began to build the open jdk , I still suffer below error warning .


Error:

Error1:

/openjdk/hotspot/src/share/vm/oops/constantPoolOop.cpp:272:39: error: converting 'false' to pointer type 'methodOop' [-Werror=conversion-null]
cc1plus: all warnings being treated as errors

ANS:Change =>

return false

to

return NULL

you may suffer the some issue in other cpp files , just try to replace "return false" to "return NULL", it is very useful for me.


Error2:

gcc: error: unrecognized command line option '-mimpure-text'

ANS:remove the command "-mimpure-text" in the code: /openjdk/jdk/make/common/shared/Compiler-gcc.gmk


Error3:

< ../../../src/share/classes/java/util/CurrencyData.properties Error: time is more than 10 years from present: 1120165200000

ANS:Edit the openjdk/jdk/src/share/classes/java/util/CurrencyData.properties for every date time like

TR=TRL;2004-12-31-22-00-00;TRY

to

TR=TRL;2014-12-31-22-00-00;TRY

other like 2005-06-30 need to update to 2015-06-30 also , after that, this issue is resolved


Thanks for the strong internet helping me resolve above issue , and please forgive my ugly English.大笑


猜你喜欢

转载自blog.csdn.net/lego2816/article/details/48807709