Apache OpenOffice (AOO) Bugzilla – Issue 111555
SDK: Mac OS 10.6: Java examples do not run
Last modified: 2017-05-20 09:32:14 UTC
Mac OS 10.6 (Snow Leopard) comes with a 64 bit JRE (this is different from previous Mac OS X versions). Thus, invocation of "java" by default initializes a 64 bit JRE. Any native library used by this environment must be 64 bit. Java UNO simple bootstrap uses a pipe urp connection, which relies on the native URE library libjpipe.dylib. This lib, like all other URE libs is only available as 32 bit binary. Therefore, JRE is unable to load the lib and the pipe connection to the office cannot be established. ============================================ [macbookpro-kso:examples/java/DocumentHandling] ks93798% make DocumentConverter.run mkdir -p /Users/ks93798/OpenOffice.org3.2_SDK/MACOSXexample.out/misc/JavaDocumentHandlingExamples/converted_files "/System/Library/Frameworks/JavaVM.Framework/Versions/1.6.0/Commands/java" -Dcom.sun.star.lib.loader.unopath="/Applications/Oracle Open Office.app/Contents/MacOS" -jar /Users/ks93798/OpenOffice.org3.2_SDK/MACOSXexample.out/class/JavaDocumentHandlingExamples/DocumentConverter.jar "./test" "MS Word 97" "doc" "/Users/ks93798/OpenOffice.org3.2_SDK/MACOSXexample.out/misc/JavaDocumentHandlingExamples/converted_files" Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.star.lib.loader.Loader.main(Loader.java:138) Caused by: java.lang.UnsatisfiedLinkError: com.sun.star.lib.connections.pipe.PipeConnection.createJNI(Ljava/lang/String;)I at com.sun.star.lib.connections.pipe.PipeConnection.createJNI(Native Method) at com.sun.star.lib.connections.pipe.PipeConnection.<init>(PipeConnection.java:125) at com.sun.star.lib.connections.pipe.pipeConnector.connect(pipeConnector.java:134) at com.sun.star.comp.connections.Connector.connect(Connector.java:138) at com.sun.star.comp.urlresolver.UrlResolver$_UrlResolver.resolve(UrlResolver.java:120) at com.sun.star.comp.helper.Bootstrap.bootstrap(Bootstrap.java:282) at DocumentConverter.main(DocumentConverter.java:188) ... 5 more ============================================ Solution is to enforce 32 bit JRE, for instance by using the "-d32" switch when invoking java. This holds true not just for Mac OS 10.6. This switch is available on Mac, Linux and Solaris, but not on Windows! Refer to http://java.sun.com/javase/6/docs/technotes/guides/vm/index.html for details for Standard HotSpot VM Options.
jsc: it's a known problem and not only on Mac OS. I thought it had been documented already but it's not. Solution is to document it and find a way to detect if 32 or 64 bit Java is used. The necessary java option should be configured then automatically.
>it's a known problem and not only on Mac OS. I thought it had been >documented already but it's not. Solution is to document it Now it is documented - by this issue. ;-) > and find a way to detect if 32 or 64 bit Java is used. IMO, SDK setup should detect whether 32 or 64 bit Office is to be used with the SDK and the JRE should be selected/started accordingly. > The necessary java option should be configured then automatically. Agreed.
fixed on cws gridcontrol04 if 64 bit Java is detected, the option -d32 is used to ensure a 32 bit runtime environment. Used when running Java examples.
jsc -> misheto: please verify
Verified.
.
(In reply to comment #3) > fixed on cws gridcontrol04 > > if 64 bit Java is detected, the option -d32 is used to ensure a 32 bit > runtime environment that breaks on Linux 64 bits: [ariel@localhost OfficeBean]$ make OOoBeanViewer.run "/opt/jdk1.6/bin/java" -d32 -classpath "/opt/openoffice.org/ure/share/java/jurt.jar:/opt/openoffice.org/ure/share/java/ridl.jar:/opt/openoffice.org/ure/share/java/juh.jar:/opt/openoffice.org/basis3.4/program/classes/unoil.jar:/opt/openoffice.org/basis3.4/program/classes/officebean.jar:/home/ariel/openoffice.org3.4_sdk_x86-64/LINUXexample.out/class/OOoBeanViewer" com.sun.star.comp.beans.OOoBeanViewer Running a 32-bit JVM is not supported on this platform. make: *** [OOoBeanViewer.run] Error 1
"arielch" committed SVN revision 1398378 into trunk: #i111555# - Don't force 32 bits JVM on Linux
(In reply to comment #8) > "arielch" committed SVN revision 1398378 into trunk: > #i111555# - Don't force 32 bits JVM on Linux Please verify I didn't break Mac OS.
Fixed