Issue 44154 - Java does not work on Mac OS X
Summary: Java does not work on Mac OS X
Status: CLOSED FIXED
Alias: None
Product: porting
Classification: Code
Component: MacOSX (show other issues)
Version: 680m79
Hardware: Mac Mac OS X, all
: P1 (highest) Trivial (vote)
Target Milestone: OOo 2.0
Assignee: eric.bachard
QA Contact: issues@porting
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-05 13:42 UTC by jogi
Modified: 2005-06-17 20:32 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
min version1.3.1 max version is 1.4.2 for Java on Mac OSX (321 bytes, patch)
2005-04-11 15:25 UTC, eric.bachard
no flags Details | Diff
workaround to make javaldx happy Mac OSX _experimental_ (358 bytes, patch)
2005-04-11 15:27 UTC, eric.bachard
no flags Details | Diff
new fix, clean this time, for javaldx / jvmfwk on Mac OSX m92 (242 bytes, patch)
2005-04-11 16:05 UTC, eric.bachard
no flags Details | Diff
patch for missing symlinks (libhsqldb2 libjava_uno ) (583 bytes, patch)
2005-04-18 19:19 UTC, eric.bachard
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description jogi 2005-03-05 13:42:28 UTC
Environment:
Mac OS X: 10.3.8
Tools -> Options -> Java: 1.4.2_05 (Vendor: Apple Computer, Inc.)

Issue 1:
Loading from CVS
qa/qatesttool/global/input/xml_filter/*.xml reports a "Gener Error. Input/Output Error"
=> These important (MS Word ML, MS Excel ML, XHTML-Export) XSLT based filters needs Java

Issue 2:
Loading from CVS
qa/qatesttool/global/input/java/java.htm
=> Crash (since 1.1.x it has not been fixed)

Issue 3:
Loading from CVS
File -> Wizards -> Letter (and all other Java written filters)
=> Nothing happens.

To get a Mac OS X OOo 2.0 Beta IMHO this issues has to be fixed because it works fine on all other 
UNIX also with Java 1.4.*
Comment 1 pavel 2005-03-05 16:01:01 UTC
Issue confirmed.
Comment 2 Martin Hollmichel 2005-03-06 08:56:12 UTC
mh->jl: do you have a hint which area we have to look at ? setting Prio to 1 as
major areas do not work.
Comment 3 pavel 2005-03-06 11:05:16 UTC
On my system:

iMac:/opt/openoffice.org1.9.82/program oo$ ./javaldx 
/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/ppc/client:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/ppc/native_threads:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/ppc
iMac:/opt/openoffice.org1.9.82/program oo$ 
Comment 4 joachim.lingner 2005-03-07 08:56:33 UTC
This can have a lot of reasons.
Wrong LD_LIBRARY_PATH, VM start parameters, missing packages. However,  this has
to be solved in the respective porting projects. 
Comment 5 pavel 2005-03-17 08:16:10 UTC
take over.
Comment 6 pavel 2005-04-07 21:32:35 UTC
Eric: please take this issue from me.
Comment 7 eric.bachard 2005-04-09 23:31:47 UTC
Hi,

About Issue 3 :  letter and fax are now working.

I just have made some changes in
<http://www.openoffice.org/issues/show_bug.cgi?id=43540> and I'll work
intensively on this issue this week : m92 is building with --enable-debug flags
(fr / en-US only, because I have no more place on my disk, sorry for de version) 

Florian, does it matter if I upload en-US version for you ?

BTW : isn't this issue somewhere a duplicate of #i43540# ?

Comment 8 florian 2005-04-11 11:10:19 UTC
Only applying the patch you provided in i43450 does not work for me. Letter and Fax do NOT work. Did  
you do anything else apart from building with --enable-debug which mustn't change any of the 
functionality of OOo?
Comment 9 eric.bachard 2005-04-11 15:01:00 UTC
ericb -> fheckl

I have noticed it doesn't work for you. Don't know what happens.  Do you apply
the change while building or before ?

Maybe we can declare this issue as duplicated of #i43540#  and concentrate in it
the infos ?

BTW : I'll put new infos in #i43540#

-- 
eric bachard
Comment 10 eric.bachard 2005-04-11 15:24:34 UTC
I continue here. I am testing new changes for java on Mac OSX :

first patch concerns  jvmfwk_distributions_OpenOffice.org_javavendors.xml.patch
-> changed max version for 1.4.2

second patch concerns jvmfwk_plugins_sunmajor_pluginlib.otherjre.cxx.patch :

using javaldx, the return gave Linux PPC directories, I know well.  Because I
don't know why else case don't work, I have added Mac OSX arch. Rebuilding
jvmfwk gives now correct directories for java on Mac OSX +  PPC cases ? 
Probably something is buggy here.

Florian, can you try, please ? To obtain more information, I have used :
ktrace javaldx
kdump

Of course, I can be wrong, these changes are only experimental tries, like the
last patch (ugly workaround to find what happens).

FYI, Linux PPC java paths are : $JAVA_HOME/lib/ppc/*  ( * = native_threads
client .... )
Comment 11 eric.bachard 2005-04-11 15:25:37 UTC
Created attachment 24924 [details]
min version1.3.1 max version is 1.4.2 for Java on Mac OSX
Comment 12 eric.bachard 2005-04-11 15:27:09 UTC
Created attachment 24925 [details]
workaround to make javaldx happy Mac OSX _experimental_
Comment 13 eric.bachard 2005-04-11 15:58:18 UTC
I found a typo in jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx

MACOX in place of MACOSX

...a new patch is coming


Comment 14 eric.bachard 2005-04-11 16:03:06 UTC
The old patch is no more necessary , just use the last one, and javldx will now
correctly recognize java path.
Comment 15 eric.bachard 2005-04-11 16:05:05 UTC
Created attachment 24926 [details]
new fix, clean this time, for javaldx / jvmfwk on Mac OSX m92
Comment 16 florian 2005-04-12 00:03:50 UTC
Issue 3 is solved by creating a symlink from libjava_uno.dylib to libjava_uno.jnilib
A more precise error message for Issue 2 is "Apple AWT Java VM was loaded on first thread -- can't 
start AWT."
Comment 17 eric.bachard 2005-04-13 15:39:57 UTC
ericb -> Florian 

Thank's for this report : look's like every java lib needs to be .jnilib called,
because of the opening method ( java native i.... ). If I understand correctly
Fridrich's answer, AWT is in java since 1.3.x at least, so java vm don't work
correctly (but partially only).

From my side, Issue 3 is not completely solved, because autopillot for agenda
don't work (OOo freezes...)

To make a point, I'm now building m93 (build will probably end ~ this evening )
and :
- jre is changed for 1.4.2
- max version in javavendors.xml is 1.4.2 too
- now path for javaldx is correct ( libawt will be found)
- what else ??

I really am interested to test... to add a comment, we have to investigate with
missing symlink(s), but following give already us a positive answer :
- libjava_uno.dylib to libjava_uno.jnilib
- libhsqldb2.dylib to libhsqldb2.jnilib

And probably others not listed yet will be usefull

-- 
eric bachard
Comment 18 eric.bachard 2005-04-17 22:53:56 UTC
New test with new changes in jvmfwk/plugins/sunmajor/pluginlib/util.cxx where I
have changed the one line only :

/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2 

With  the probably more correct :

/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1,
/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2 

This way, I think both 1.3.1 *and* 1.4.2 jre will be available, and all case
will work.  After more investigations with m93 fr/de/en-US I have uploaded :
web page wizard needs jre1.3.1  (just run soffice.bin -> it works)
database needs 1.4.2 ( run normally soffice -> it works )
Thank's to Florian for his comments and confirmations.

Note  : in the second case, 1.4.2 DYLD_LIBRARY_PATH use java_library_path,
containing 1.4.2 path. In the first, javaldx return is ignored, so 1.3.1 is used.

Don't know if my last change will give what expected. New build always in
progress (and cws in a hurry :-/  ), but I cannot commit these changes, nor send
a patch before I have myself verified it works. Sorry for the ost time.

-- 
eric bachard
Comment 19 florian 2005-04-18 13:24:58 UTC
One small correction to Eric's last comment:
The web wizard (among other things) apparently needs AWT. The reason it fails with Apple's latest 
version of Java 1.4.2 is that Apple does not allow the creation of AWT in the main thread as the error 
message states: "Apple AWT Java VM was loaded on first thread -- can't start AWT."
A further problem is that you are only allowed to use that VM in the thread that created it. Otherwise 
you get a "Bus error".
Apple provides some sample code at http://developer.apple.com/samplecode/simpleJavaLauncher/
simpleJavaLauncher.html
Unfortunately I have no clue how we can do this in OOo or at least where to start. I tried several things 
already but did not succeed.
Comment 20 Martin Hollmichel 2005-04-18 14:30:13 UTC
regarding webwezard we should generate a dependent issue. In webwizard there is
a "import javax.swing.DefaultListModel" which seems to cause on of the problems.
Comment 21 eric.bachard 2005-04-18 19:19:26 UTC
Created attachment 25183 [details]
patch for missing symlinks (libhsqldb2  libjava_uno )
Comment 22 eric.bachard 2005-04-18 19:24:43 UTC
Attached patch works for me : symlinks libhsqldb2.jnilib and libjava_uno.jnilib
are really created while installing. I'll commit it in macosx06 asap

ericb -> mh

About webwizard : I completely agree with you, and I'll open a new issue just
for webwizard

-- 
eric bachard

Comment 23 eric.bachard 2005-04-18 20:03:16 UTC
Fixed in macosx06
Comment 24 eric.bachard 2005-04-18 21:31:42 UTC
Verified with my own build
Comment 25 eric.bachard 2005-04-25 16:12:43 UTC
Verified in macosx06
Comment 26 eric.bachard 2005-06-17 20:32:28 UTC
closed