Who says blogging is a waste of time ? What a great example right here. You may remember that on Monday I blogged about my first Lotus Notes 8.5 application for the Mac. Now, I originally started this project last summer! That's right over 6 months ago. When I hit the roadblock that I documented on Monday, I quickly started to search the web. Nothing turned up an answer. Since Notes 8.5 was still in beta at that time, I decided to abandon the effort.
When Notes 8.5 shipped earlier in the year, I thought it would be a good idea to pick up the project again. I knew that if I hit a roadblock, I could get official support. Well, as I said earlier this week, I was stuck because I couldn't call the Notes API from my SWT Java program. At that point, I blogged about my status, and quickly summarized what I had done up until that point. I also noted that I had opened an IBM Support ticket and was waiting for assistance.
And then magic happened! 1 hour and 22 minutes after I posted the blog, the answer came to me!!! Karsten Lehmann, one of the developers for MindPlan, kindly posted a comment detailing that he had gone through the same issue. He suggested a couple of things, I responded back and voilá!
Here's how I configured Eclipse to run my SWT Java application for Notes in my Mac OSX Leopard:
- Under Arguments, added the following VM Argument: -Djava.library.path=/Applications/Notes.app/Contents/MacOS
- Under JRE I selected Java 1.5.0 (for some reason it wouldn't work with Java 1.6)
- Under Environment I added 3 environment variables:
- PATH -> /Applications/Notes.app/Contents/MacOS
- LD_LIBRARY_PATH -> /Applications/Notes.app/Contents/MacOS
- DYLD_LIBRARY_PATH -> /Applications/Notes.app/Contents/MacOS
At this point I could get my application running beautifully under Eclipse, but I couldn't run it as a stand-alone application. Time to do some more searching!! After a couple of days, I finally figured it out. First, Eclipse includes a really cool feature that lets you export your Java applications as Mac Bundles.
Next, because of the way Mac works, I had to set the DYLD_LIBRARY_PATH environment variable first, before running my application. Therefore, I had to create the file ~/.profile with the following line:
export DYLD_LIBRARY_PATH=/Applications/Notes.app/Contents/MacOS |
And now, IBMers can use Atlas from their Mac computers!
"She suggested [...]"
ReplyDelete->HE suggested ;-)
Grr.. I had it right the first time.. "that HE had gone through..."
ReplyDeleteSORRY!! It's fixed now! :)
Hi Luis,
ReplyDeleteI am having some trouble getting a Notes Sidebar application I am developing to work on the Mac platform.
I was wondering if my difficulties are related to the DYLD_LIBRARY_PATH you mention here. My problem is that the NotesJob (& NotesSessionJob) objects, from NotesJavaApiUtils8.5.jar (& 8.5.1), do not run. As I am using this jar file on the local system do I need to set an Environment variable for use on Macs?
Any suggestions would be much appreciated. Thanks.
Regards, Andrew Welch
Andrew, did you already set up the environment variable in your .profile file ?
ReplyDeleteHi Luis,
ReplyDeleteSorry for the very slow response. I've been busy with other projects, plus had time off so I didn't notice the response.
Yes I have tried creating a .profile file, with no result.
After extensive testing I have found that the NotesJob works fine on the Mac with a normal HTTP connection, however an HTTPS connection within the NotesJob fails with the error:
"Communication with the service provider failed. java.security.cert.CertificateException: Timeout occurred waiting for message"
I also tried manually Cross-Certifying the necessary site certificate.
I am using the NotesJob as on Windows it was the only way I successfully created an HTTPS connection from inside the Notes Sidebar. A lovely piece of irony.
Thanks