[Gvsig_english] gvSIG and Java on Mac OS X

Mijail hmijail at gmail.com
Fri Oct 17 12:23:07 CEST 2008


Some more brainstorming: I'd be careful with the relative paths in the  
script. Mainly, the "../NativeLibs" sounds bad (yes, it should work,  
but I would just make that an absolute path - maybe I suffered too  
many of those kind of errors).
And try "man dyld" for some hints on the debugging facilities offered  
by OS X's linker. For example, "export DYLD_PRINT_LIBRARIES=true"  
should let you know if the native libraries are being found - which is  
another suspicion I'm having, since the native libs have been built to  
be used in a bundle and might need some massaging)

(and yet, I don't think none of this really addresses the  
"java.lang.NoClassDefFoundError: Could not initialize class  
com.iver.cit.gvsig.fmap.crs.CRSFactory" you report. Could you send a  
complete log up to that moment?)



El 17/10/2008, a las 11:11, Benjamin Ducke escribió:

> OK, I have adjusted the classpath but no luck.
>
> However, things work just fine if I use the systems's
> own 1.5 JDK!
>
> Apparently, something is missing in the Soylatte JRE.
>
> I think I will give up on this for now, it is just taking
> too much time (thanks, Apple for f****** up Java 6 on OS X like  
> that!).
> Will have to advise users on Mac OS X 10.4 that they won't be able
> to get good Java performance for now and will have to upgrade to
> 10.5 if they need it (talk about vendor lock-in...).
>
> Ben
>
>
> Benjamin Ducke wrote:
>> Mijail,
>>> You should NOT touch the symlinks in the JavaVM framework unless  
>>> you have a very good reason and understanding of why. Usually you  
>>> should just use the Java Preferences app pointed to by Henning.
>> Yeah, that's what I found out, too ;)
>>>
>>> And in your case, using SoyLatte, you should be already  
>>> independent of that.
>>>
>>> Which I guess is what you have run into when you say that gvSIG  
>>> chooses Java 1.5. I don't know how SoyLatte gets installed, but I  
>>> don't expect it to weave itself into the OS X Java installation,  
>>> without which the JavaApplicationStub inside gvSIG.app/Contents/ 
>>> MacOS (which can be in part controlled with the Java  
>>> Preferences.app) will not go anywhere near your SoyLatte.
>> Yes, the problem is that Soylatte is a standard JRE distribution
>> ("bin","lib", ...), not one of those Apple Frameworks, so there is no
>> way of cleanly integrating that into the rather complex Apple system
>> of Java deployment.
>>>
>>> So I guess your shell script is the way to go to use SoyLatte.
>> Well, it's almost working, so I will keep tuning it.
>> I'll see if adjusting the classpath as you suggested fixes the
>> problem. If not, I'll report back to this list.
>> Thanks for the help,
>> Ben
>> P.S.:
>> I am running this on Intel Mac OS X 10.4
>>>
>>> So what would I guess the problem is? We know CRS is not working  
>>> in PowerPC, BUT its exact failure mode was that it caused an  
>>> exception when you tried to load a layer. So you should be able to  
>>> at least show the gvSIG desktop and play a bit with it, even with  
>>> the CRS problem (which you can fix by just taking away the CRS  
>>> extension, as Agustin demonstrated).
>>>
>>> To me, it certainly looks like it is failing to find the CRS  
>>> extension. Not sure though.
>>> I would suggest checking the classpath, since the one you are  
>>> using looks different to the one we are using in OS X. You can  
>>> check it in the file gvSIG.app/Contents/Info.plist, which is XML,  
>>> and which contains this classpath:
>>>      <key>ClassPath</key>
>>>      <array>
>>>        <string>andami.jar</string>
>>>        <string>lib/log4j-1.2.8.jar</string>
>>>        <string>lib/beans.jar</string>
>>>        <string>lib/gvsig-i18n.jar</string>
>>>        <string>lib/iver-utiles.jar</string>
>>>        <string>lib/castor-0.9.5.3-xml.jar</string>
>>>        <string>lib/crimson.jar</string>
>>>        <string>lib/xerces_2_5_0.jar</string>
>>>        <string>lib/javaws.jar</string>
>>>        <string>lib/xml-apis.jar</string>
>>>        <string>lib/JWizardComponent.jar</string>
>>>        <string>lib/looks-2.0.2.jar</string>
>>>        <string>lib/kxml2.jar</string>
>>>        <string>lib/jcalendar.jar</string>
>>>        <string>lib/xmlrpc-2.0.1.jar</string>
>>>        <string>lib/commons-codec-3.1.zip</string>
>>>        <string>lib/commons-collections-3.1.zip</string>
>>>        <string>lib/commons-pool-1.2.zip</string>
>>>        <string>lib/commons-dbcp-1.0-dev-20020806.zip</string>
>>>        <string>lib/jh.jar</string>
>>>      </array>
>>>
>>>
>>> Let me know if that helps (or if I can help you avoid those gray  
>>> hairs :). I am in the process of slipping out of the gvSIG  
>>> project, but for some time I will still try to make myself  
>>> available.
>>>
>>>
>>> El 16/10/2008, a las 16:00, Henning Lorenz escribió:
>>>
>>>> You can set your Java Preferences in /Applications/Utilities/Java/ 
>>>> Java Preferences.app
>>>>
>>>> Henning
>>>>
>>>> On 2008-10-16, at 15:25 , Benjamin Ducke wrote:
>>>>
>>>>> Hi Agustin,
>>>>>
>>>>> thanks for those pointers. I will try linking to my JRE as you
>>>>> suggested, just to make sure that everything runs OK.
>>>>>
>>>>> But for a "proper" solution, I would like to avoid anything
>>>>> that touches system files, so the installation can be completely
>>>>> self-contained and won't require root access.
>>>>>
>>>>> Awesome that you got gvSIG running on PowerPCs, too.
>>>>> I will have to take a look at that. For now, the Intel version
>>>>> is giving me enough gray hair ...
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Ben
>>>>>
>>>>> Agustin Diez Castillo wrote:
>>>>>> Ben,
>>>>>> You can force Mac yo use a particular version of Java.
>>>>>> All versions reside at
>>>>>> /System/Library/Frameworks/JavaVM.framework/Versions
>>>>>> and there a link point CurrentJDK to the version of your choice.
>>>>>> So you only need to point CurrentJDK to your 1.6 JRE.
>>>>>> But anyhow if you're in PPC machine you need to take out the  
>>>>>> crs folder (this is true after the 913 build including 12xx).  
>>>>>> I've prepared a Mac version with sextante and gvSIG mobile for  
>>>>>> PPC machines [1].
>>>>>> Agustin
>>>>>> [1] http://gvsigmac.blogspot.com/2008/08/gvsig-112-running-on-mac-ppcs.html
>>>>>> El Oct 16, 2008, a las 2:47 PM, Benjamin Ducke escribió:
>>>>>>> Dear developers/list,
>>>>>>>
>>>>>>> I am currently trying to understand how Java works on Mac OS X.
>>>>>>> Since Apple decides what Java gets installed on any version of
>>>>>>> Mac OS X, not the user, I would like to be able and bundle my  
>>>>>>> own
>>>>>>> 1.6 JRE with gvSIG, so that I can deploy an identical version on
>>>>>>> any Mac.
>>>>>>>
>>>>>>> As a JRE, I am using the Soylatte FreeBSD port and that seems  
>>>>>>> to run
>>>>>>> fine, but gvSIG always picks up the system's outdated Java 1.5  
>>>>>>> (I am
>>>>>>> running on Mac OS 10.4 with no intentions whatsoever to update
>>>>>>> to 10.5).
>>>>>>>
>>>>>>> Now, I have tried to recreate the whole Java startup procedure  
>>>>>>> using
>>>>>>> a shell script, which I modeled after the one for Linux:
>>>>>>>
>>>>>>> ----
>>>>>>>
>>>>>>> #!/bin/sh
>>>>>>> # gvSIG.sh: startup script for gvSIG on Mac OS X
>>>>>>> PATH_TO_GVSIG="/Users/bartsimpson/Desktop/gvSIG1.1.2.app"
>>>>>>> PATH_TO_RES="$PATH_TO_GVSIG/Contents/Resources/gvSIG/gvSIG  
>>>>>>> 1.1.2 build 1045.app/Contents/Resources"
>>>>>>>
>>>>>>> export DYLD_LIBRARY_PATH="$PATH_TO_RES/NativeLibs"
>>>>>>> export PROJ_LIB="$PATH_TO_RES/Java/gvSIG/extensiones/ 
>>>>>>> org.gvsig.crs/data"
>>>>>>>
>>>>>>> cd "$PATH_TO_RES/Java"
>>>>>>>
>>>>>>> # Setup Java environment and run gvSIG
>>>>>>>
>>>>>>> # Java tuning settings
>>>>>>> MAX_HEAP=512
>>>>>>> INI_HEAP=512
>>>>>>>
>>>>>>> JAVA_VM="/Users/bartsimpson/Desktop/soylatte16-i386-1.0.3/bin/ 
>>>>>>> java"
>>>>>>>
>>>>>>> $JAVA_VM -Djava.library.path="../NativeLibs" -cp andami.jar:./ 
>>>>>>> lib/gvsig-i18n.jar:./lib/beans.jar:./lib/log4j-1.2.8.jar:./lib/ 
>>>>>>> iver-utiles.jar:./lib/castor-0.9.5.3-xml.jar:./lib/ 
>>>>>>> crimson.jar:./lib/xerces_2_5_0.jar:./lib/javaws.jar:./lib/xml- 
>>>>>>> apis.jar:./lib/looks-2.0.2.jar:./lib/JWizardComponent.jar:./ 
>>>>>>> lib/kxml2.jar:./lib/jcalendar.jar:./lib/jh.jar -Xms$ 
>>>>>>> {INI_HEAP}M -Xmx${MAX_HEAP}M com.iver.andami.Launcher gvSIG  
>>>>>>> gvSIG/extensiones "$@"
>>>>>>>
>>>>>>> ----
>>>>>>>
>>>>>>> This goes almost all the way to starting gvSIG, but eventually  
>>>>>>> fails:
>>>>>>>
>>>>>>> java.lang.reflect.InvocationTargetException
>>>>>>>     at java.awt.EventQueue.invokeAndWait(EventQueue.java:997)
>>>>>>>     at  
>>>>>>> javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java: 
>>>>>>> 1323)
>>>>>>>     at com.iver.andami.Launcher.main(Unknown Source)
>>>>>>> Caused by: java.lang.NoClassDefFoundError: Could not  
>>>>>>> initialize class com.iver.cit.gvsig.fmap.crs.CRSFactory
>>>>>>>     at com.iver.cit.gvsig.project.Project.<clinit>(Unknown  
>>>>>>> Source)
>>>>>>>     at  
>>>>>>> com 
>>>>>>> .iver.cit.gvsig.project.ProjectFactory.createProject(Unknown  
>>>>>>> Source)
>>>>>>>     at  
>>>>>>> com.iver.cit.gvsig.ProjectExtension.loadInitialProject(Unknown  
>>>>>>> Source)
>>>>>>>     at  
>>>>>>> com.iver.cit.gvsig.ProjectExtension.postInitialize(Unknown  
>>>>>>> Source)
>>>>>>>     at  
>>>>>>> com.iver.andami.Launcher.postInitializeExtensions(Unknown  
>>>>>>> Source)
>>>>>>>     at com.iver.andami.Launcher.access$600(Unknown Source)
>>>>>>>     at com.iver.andami.Launcher$4.run(Unknown Source)
>>>>>>>     at  
>>>>>>> java.awt.event.InvocationEvent.dispatch(InvocationEvent.java: 
>>>>>>> 199)
>>>>>>>     at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
>>>>>>>     at  
>>>>>>> com.iver.andami.ui.AndamiEventQueue.dispatchEvent(Unknown  
>>>>>>> Source)
>>>>>>>     at  
>>>>>>> java 
>>>>>>> .awt 
>>>>>>> .EventDispatchThread 
>>>>>>> .pumpOneEventForFilters(EventDispatchThread.java:273)
>>>>>>>     at  
>>>>>>> java 
>>>>>>> .awt 
>>>>>>> .EventDispatchThread 
>>>>>>> .pumpEventsForFilter(EventDispatchThread.java:183)
>>>>>>>     at  
>>>>>>> java 
>>>>>>> .awt 
>>>>>>> .EventDispatchThread 
>>>>>>> .pumpEventsForHierarchy(EventDispatchThread.java:173)
>>>>>>>     at  
>>>>>>> java 
>>>>>>> .awt.EventDispatchThread.pumpEvents(EventDispatchThread.java: 
>>>>>>> 168)
>>>>>>>     at  
>>>>>>> java 
>>>>>>> .awt.EventDispatchThread.pumpEvents(EventDispatchThread.java: 
>>>>>>> 160)
>>>>>>>     at  
>>>>>>> java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Can someone on this list make sense of that error message?
>>>>>>> Is the problem with the CRS library? Did I forget to include
>>>>>>> something into the Java classpath or the system's linker path?
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Ben
>>>>>>>
>>>>>>>
>>>>>>> -- 
>>>>>>> Benjamin Ducke
>>>>>>> Senior Applications Support and Development Officer
>>>>>>>
>>>>>>> Oxford Archaeology Ltd
>>>>>>> Janus House
>>>>>>> Osney Mead
>>>>>>> OX2 0ES
>>>>>>> Oxford, U.K.
>>>>>>>
>>>>>>> Tel: +44 (0)1865 263 800 (switchboard)
>>>>>>> Tel: +44 (0)1865 980 758 (direct)
>>>>>>> Fax :+44 (0)1865 793 496
>>>>>>> benjamin.ducke at oxfordarch.co.uk
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ------
>>>>>>> Files attached to this email may be in ISO 26300 format (OASIS  
>>>>>>> Open Document Format). If you have difficulty opening them,  
>>>>>>> please visit http://iso26300.info for more information.
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Gvsig_internacional mailing list
>>>>>>> Gvsig_internacional at runas.cap.gva.es
>>>>>>> http://runas.cap.gva.es/mailman/listinfo/gvsig_internacional
>>>>>>>
>>>>>> _______________________________________________
>>>>>> Gvsig_internacional mailing list
>>>>>> Gvsig_internacional at runas.cap.gva.es
>>>>>> http://runas.cap.gva.es/mailman/listinfo/gvsig_internacional
>>>>>
>>>>>
>>>>> -- 
>>>>> Benjamin Ducke
>>>>> Senior Applications Support and Development Officer
>>>>>
>>>>> Oxford Archaeology Ltd
>>>>> Janus House
>>>>> Osney Mead
>>>>> OX2 0ES
>>>>> Oxford, U.K.
>>>>>
>>>>> Tel: +44 (0)1865 263 800 (switchboard)
>>>>> Tel: +44 (0)1865 980 758 (direct)
>>>>> Fax :+44 (0)1865 793 496
>>>>> benjamin.ducke at oxfordarch.co.uk
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ------
>>>>> Files attached to this email may be in ISO 26300 format (OASIS  
>>>>> Open Document Format). If you have difficulty opening them,  
>>>>> please visit http://iso26300.info for more information.
>>>>>
>>>>> _______________________________________________
>>>>> Gvsig_internacional mailing list
>>>>> Gvsig_internacional at runas.cap.gva.es
>>>>> http://runas.cap.gva.es/mailman/listinfo/gvsig_internacional
>>>>
>>>>
>>>> _______________________________________________
>>>> Gvsig_internacional mailing list
>>>> Gvsig_internacional at runas.cap.gva.es
>>>> http://runas.cap.gva.es/mailman/listinfo/gvsig_internacional
>>>
>>>
>>> _______________________________________________
>>> Gvsig_internacional mailing list
>>> Gvsig_internacional at runas.cap.gva.es
>>> http://runas.cap.gva.es/mailman/listinfo/gvsig_internacional
>>>
>>>
>
>
> -- 
> Benjamin Ducke
> Senior Applications Support and Development Officer
>
> Oxford Archaeology Ltd
> Janus House
> Osney Mead
> OX2 0ES
> Oxford, U.K.
>
> Tel: +44 (0)1865 263 800 (switchboard)
> Tel: +44 (0)1865 980 758 (direct)
> Fax :+44 (0)1865 793 496
> benjamin.ducke at oxfordarch.co.uk
>
>
>
>
> ------
> Files attached to this email may be in ISO 26300 format (OASIS Open  
> Document Format). If you have difficulty opening them, please visit http://iso26300.info 
>  for more information.
>
> _______________________________________________
> Gvsig_internacional mailing list
> Gvsig_internacional at runas.cap.gva.es
> http://runas.cap.gva.es/mailman/listinfo/gvsig_internacional




More information about the Gvsig_internacional mailing list