On Tue, Aug 30, 2005 at 05:18:45PM -0500, [EMAIL PROTECTED] wrote:
>  
> > From: Tim Bunce [mailto:[EMAIL PROTECTED] 
> > 
> > Can't locate file 'libjvm.bundle' anywhere under 
> > '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home'
> > Writing Makefile for Inline::Java
> 
> [...]
> 
> > make[1]: Makefile: No such file or directory
> > make[1]: *** No rule to make target `Makefile'.  Stop.
> > make: *** [subdirs] Error 2
> > 
> > Any ideas?
> 
> Ordinarily a Makefile will be created in both the top-level directory
> and the Java/ directory.  I think it bombed out when trying to create
> one or the other.

The make failed because the Java/Makefile.PL exits 'successfully' but
without creating a Makefile after printing the "Can't locate ..." warning.

> Looking on my office Mac (OS X 10.4.2), I see three libjvm files, none
> of which is "libjvm.bundle":
> 
> /System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Libraries/libjvm.dylib
> /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Libraries/libjvm.dylib
> /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Libraries/libjvm_compat.dylib
> 
> So I think:
> 
>   a) Perhaps it should be looking for "libjvm.$Config{so}" instead of 
> "libjvm.$Config{dlext}".
> 
>   b) It probably *still* won't find it, so either it needs to be able to
> look in other directories besides those under $J2SDK, or you'll have to
> create a symlink from somewhere under $J2SDK to
> /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Libraries/ or 
> something.
> 
> Note that I'm not speaking from the point of view of someone who's
> actually got this working - I'm just speculating, since last time I
> tried this I was on 10.3, and I never got it working that time either.

Now I come to look again I've made some progress with your help. Thanks!

I've added a symlink in .../Home/lib/libjvm.dylib -> 
../../Libraries/libjvm.dylib
(libjvm.dylib is itself a symlink to libhotspot.dylib) and added
        JVM_LIB  => "libjvm.$Config{so}",
        JVM_SO   => "libjvm.$Config{so}",
into the darwin section of Java/Portable.pm

The linker command line now looks like:

 
LD_RUN_PATH="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/lib"
 env MACOSX_DEPLOYMENT_TARGET=10.3 cc  -bundle -undefined dynamic_lookup
 -L/usr/local/lib -L/opt/local/lib JNI.o  -o 
../blib/arch/auto/Inline/Java/JNI/JNI.dylib
 -L/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/lib 
-ljvm   

and otool -L blib/arch/auto/Inline/Java/JNI/JNI.dylib says:

  blib/arch/auto/Inline/Java/JNI/JNI.dylib:
        
/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Libraries/libhotspot.dylib
 (compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 88.0.0)

but the tests still fail with:

t/01_init..............dyld: NSLinkModule() error dyld: Symbol not found: 
_JNI_CreateJavaVM
  Referenced from: 
/Users/timbo/.cpan/sources/authors/id/P/PA/PATL/Inline-Java-0.50/blib/arch/auto/Inline/Java/JNI/JNI.bundle
  Expected in: dynamic lookup

I don't have sufficient OSX Foo to know what to try next.
Is the _JNI_CreateJavaVM entrypoint in some other library?
(grep -l -a -r _JNI_CreateJavaVM ... only finds it in that one.)

Any ideas?

Tim.

Reply via email to