Bug 819 - compilation fails to locate JavaVM.framework/Libraries
Summary: compilation fails to locate JavaVM.framework/Libraries
Status: RESOLVED INVALID
Alias: None
Product: Jogl
Classification: JogAmp
Component: macosx (show other bugs)
Version: 2
Hardware: pc_x86_64 macosx
: --- blocker
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2013-08-22 05:55 CEST by Ricardo Fabbri
Modified: 2013-10-05 02:16 CEST (History)
1 user (show)

See Also:
Type: ---
SCM Refs:
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ricardo Fabbri 2013-08-22 05:55:18 CEST
Compilation fails as follows

rfabbri@MacBook-Pro:~/src/jogl/make$ ant

...
BUILD FAILED
/Users/rfabbri/src/jogl/make/build.xml:71: The following error occurred while executing this line:
/Users/rfabbri/src/jogl/make/build-nativewindow.xml:740: The following error occurred while executing this line:
/Users/rfabbri/src/jogl/make/build-nativewindow.xml:681: /System/Library/Frameworks/JavaVM.framework/Libraries does not exist.



This is Mac OSX 10.8.4 and git branch master 2cb2845
Comment 1 Julien Gouesse 2013-08-29 15:44:09 CEST
(In reply to comment #0)
> Compilation fails as follows
> 
> rfabbri@MacBook-Pro:~/src/jogl/make$ ant
> 
> ...
> BUILD FAILED
> /Users/rfabbri/src/jogl/make/build.xml:71: The following error occurred
> while executing this line:
> /Users/rfabbri/src/jogl/make/build-nativewindow.xml:740: The following error
> occurred while executing this line:
> /Users/rfabbri/src/jogl/make/build-nativewindow.xml:681:
> /System/Library/Frameworks/JavaVM.framework/Libraries does not exist.
> 
> 
> 
> This is Mac OSX 10.8.4 and git branch master 2cb2845

Thanks. We should not rely on this particular directory.
Comment 2 Sven Gothel 2013-10-05 02:16:33 CEST
We only define (gluegen-cpptasks-base.xml):

+++

  <target name="setup.java.home.dir.macosx" if="isOSX">
      <!-- Java7 std location -->
      <condition property="java.home.dir"
                 value="${java.home}/..">
                 <available file="${java.home}/../include/jni.h"/>
      </condition>
      <condition property="java.includes.dir"
                 value="${java.home}/../include">
                 <available file="${java.home}/../include/jni.h"/>
      </condition>
      <!-- Fallback value Java6 -->
      <property name="java.home.dir" value="/System/Library/Frameworks/JavaVM.framework/Home" />
      <property name="java.includes.dir" value="/System/Library/Frameworks/JavaVM.framework/Headers" />
  </target>
  ...
      <condition property="java.includes.dir.platform"
                 value="${gluegen.root.abs-path}/make/stub_includes/jni/macosx">
                 <available file="${java.includes.dir}/darwin/jawt_md.h"/>
      </condition>
      <condition property="java.lib.dir.platform"
                 value="${java.home.dir}/jre/lib">
                 <available file="${java.home.dir}/jre/lib/libjawt.dylib"/>
      </condition>
      <!-- Fallback value Java6 -->
      <property name="java.includes.dir.platform" value="/System/Library/Frameworks/JavaVM.framework/Headers" />
      <property name="java.lib.dir.platform"      value="/System/Library/Frameworks/JavaVM.framework/Libraries" />

+++

.. hence if java7 is installed and PATH is set accordingly, i.e.:

JAVA_HOME=`/usr/libexec/java_home -version 1.7`
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME PATH

and will use the proper 'java.home' env. var and all shall work.
See e.g. gluegen/make/scripts/make.gluegen.all.macosx-clang.sh (similar script in jogl).

build-nativewindow.xml in jogl only uses:
  <syslibset dir="${java.lib.dir.platform}" libs="jawt" if="@{output.lib.name}.useLibJAWT"/>