Recent Changes - Search:

edit SideBar

OpenJDK

Resources

Mac OS X

December 18, 2015: Building under Mac OS X El Capitan 10.11.1

https://wiki.openjdk.java.net/display/Nashorn/Building+Nashorn says

 hg clone http://hg.openjdk.java.net/nashorn/jdk8 nashorn~jdk8

which is wrong, try:

 hg clone http://hg.openjdk.java.net/jdk8/jdk8

Then get the sources:

 cd jdk8
 sh get_source.sh 

gcc

gcc-4.3 or later is required.

I have gcc-4.4 installed from Mac Port. I tried setting various environment variables, but ended up doing:

  sudo -i ln -s /opt/local/bin/g++-mp-4.4 /usr/local/bin/g++
  sudo -i ln -s /opt/local/bin/gcc-mp-4.4 /usr/local/bin/gcc

FreeType

configure fails with:

  checking for FREETYPE... no
  configure: error: Could not find freetype!  
  configure exiting with result code 1

http://gvsmirnov.ru/blog/tech/2014/02/07/building-openjdk-8-on-osx-maverick.html suggests installing XQuartz, which was already installed, so I did:

  ./configure --with-freetype-lib=/usr/X11/lib --with-freetype-include=/usr/X11/include/freetype2

That worked

Running make: __FreeBSD__ is not defined

make eventually fails with:

  /Users/cxh/src/jdk8/hotspot/src/os/bsd/vm/os_bsd.cpp:1150:7: error: "__FreeBSD__" is not defined
  /Users/cxh/src/jdk8/hotspot/src/os/bsd/vm/os_bsd.cpp:1152:7: error: "__OpenBSD__" is not defined
  /Users/cxh/src/jdk8/hotspot/src/os/bsd/vm/os_bsd.cpp:1154:7: error: "__NetBSD__" is not defined

The fix is at http://gvsmirnov.ru/blog/tech/2014/02/07/building-openjdk-8-on-osx-maverick.html#just-a-couple-of-fixes-here-and-there-and-also-there-and-there

bash-3.2$ wget -O patch1.diff https://gist.githubusercontent.com/gvsmirnov/8634644/raw/951b248401c1ef3aebe4254e91259c0754c35124/os_bsd_cpp_defined_fix.patch

--2015-12-18 11:38:19--  https://gist.githubusercontent.com/gvsmirnov/8634644/raw/951b248401c1ef3aebe4254e91259c0754c35124/os_bsd_cpp_defined_fix.patch
Resolving gist.githubusercontent.com... 199.27.79.133
Connecting to gist.githubusercontent.com|199.27.79.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 842 [text/plain]
Saving to: 'patch1.diff'

patch1.diff         100%[=====================>]     842  --.-KB/s   in 0s

2015-12-18 11:38:20 (61.8 MB/s) - 'patch1.diff' saved [842/842]


bash-3.2$ patch < patch1.diff
can't find file to patch at input line 12
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|# HG changeset patch
|# User Gleb Smirnov <me@gvsmirnov.ru>
|# Date 1390750965 -14400
|#      Sun Jan 26 19:42:45 2014 +0400
|# Node ID 4dfd8f109dee49bc9d8c6d95d58bbce03cd662b7
|# Parent  9a11d5e679cf55c9d5df50577502fbe740407ac1
|Fixed src/os/bsd/vm/os_bsd.cpp to use defined() to determine the version of bsd
|
|diff -r 9a11d5e679cf -r 4dfd8f109dee src/os/bsd/vm/os_bsd.cpp
|--- a/src/os/bsd/vm/os_bsd.cpp Fri Jan 24 15:07:51 2014 -0800
|+++ b/src/os/bsd/vm/os_bsd.cpp Sun Jan 26 19:42:45 2014 +0400
--------------------------
File to patch: hotspot/src/os/bsd/vm/os_bsd.cpp
hotspot/src/os/bsd/vm/os_bsd.cpp
patching file hotspot/src/os/bsd/vm/os_bsd.cpp
bash-3.2$

and run make

Stray '@' in program

Running make:

Compiling /Users/cxh/src/jdk8/hotspot/src/share/vm/utilities/yieldingWorkgroup.cpp
Making signal interposition lib...
Making SA debugger back-end...
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:6,
                 from /System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:5,
                 from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
                 from /Users/cxh/src/jdk8/hotspot/agent/src/os/bsd/MacosxDebuggerLocal.m:26:
/usr/include/objc/NSObject.h:18: error: stray '@' in program
/usr/include/objc/NSObject.h:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'NSUInteger'
/usr/include/objc/NSObject.h:20: error: stray '@' in program
/usr/include/objc/NSObject.h:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Class'
/usr/include/objc/NSObject.h:43: error: stray '@' in program
/usr/include/objc/NSObject.h:43: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'NSString'
/usr/include/objc/NSObject.h:44: error: stray '@' in program
/usr/include/objc/NSObject.h:45: error: stray '@' in program
/usr/include/objc/NSObject.h:45: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'property'
/usr/include/objc/NSObject.h:53: error: expected identifier or '(' before 'interface'
/usr/include/objc/NSObject.h:59: error: expected '{' before '+' token
/usr/include/objc/NSObject.h:92: error: expected '{' before '__attribute__'
/usr/include/objc/NSObject.h:96: error: expected '{' before '+' token
 

At this point, I gave up.

Edit - History - Print - Recent Changes - Search
Page last modified on December 18, 2015, at 07:54 pm