PDA

View Full Version : Eclipse IDE on Mac OS X Preview/Run Issue


tloring
12-01-2004, 03:15 PM
I have a fresh version of Eclipse 3.0.1 with the Laszlo IDE plug in installed. I have LPS 2.2.1. Mac OS X Panther v10.3.4. Java 1.4.2_05.

I had no problems in Eclipse creating a file, palette, etc., as I have seen some threads about, luckily.

I have a problem with actually previewing and running it.

LPS is running. I confirm this by running the laszlo-explorer.
http://localhost:8080/lps-2.2.1/laszlo-explorer/

In Preferences, Laslzo...

LPS web root is correct...I believe:
/Applications/Laszlo Presentation Server 2.2.1/Server/lps-2.2.1

Web browser location:
/Applications/Safari.app

Code is simple example (from the Laszlo example on alphaWorks):

http://dl.alphaworks.ibm.com/technologies/rcb/demo.html

<canvas>
<button id="helloButton" text="Hello Laszlo"></button>
</canvas>

I have made sure I done a Save All on the file.
When I attempt to preview this, I get an error dialog:

Error loading preview
Preview failed, not available!

When I try to run it...I get the LPS reminder (it is running), I get a Error launching web browser.

I am advised to check the browser location is set up properly in preferences. It is w/i the Laszlo preferences.

I would expect that that is the Browser setting that matters, but here is additional wierdness that is more of an Eclipse problem in general:

In the general Web Browser preference, I am unable to add Safari or any other browser for that matter.

I have used the file browser to actually pick the location, so there are no typos: /Applications/Safari.app, but this results in an Error dialog "The location value is not a valid path name."

There is a slew of java messages related to this error about not being able to execute /Applications/Safari.app,

So, I am stuck...has anyone encountered this type of issue at all on Mac OS X?

Any help would be most appreciated,
Thanks,
Thom

tloring
12-01-2004, 04:11 PM
A little self-help...

I have resolved the issue of the general Web Browser Preference (and for Laszlo web browser preference as well):

You must specify the actual executable within the Safari.app package...

/Applications/Safari.app/Contents/MacOS/Safari

The browser shows up properly then in the list. I did the same for the web browser preference in the Laszlo preferences.

Not out of the woods yet. The preview still does not work.

Running it, actually fires up the browser at least, though there is an error in the path it appears, so this must be some configuration issue (and no doubt same problem for preview).

powertompa
12-01-2004, 11:49 PM
I can get a little further:

The path is incorrectly
file:///Users/..../http:/localhost:8080/lps-2.2.1/lazzlow/src/new_file.lzx%3Flzt=html

But if I remove everything up to localhost (in the browser address), the canvas comes up nice.

If I use Firefox instead as the browser, the URL is sent correctly and the "Run as Laszlo App" works fine.
Just like you said: the browser location has to be
/Users/.../firefox.app/Contents/MacOS/firefox
Not very Mac, is it? Probably an Eclipse problem though.

I can live with that work-around, but it's a drawback that preview doesn't work. The deployment to the presentation server is a little slow.

/Thomas

tloring
12-02-2004, 08:49 AM
I was running into the same problem with the URL:

file:///Users/..../http:/localhost:8080/...

Perhaps there's a paramter needed for Safari (and not required by firefox)?. I know in the general web browser preference there is a field for parameters; there is not one in the Laszlo web browser preference.

Actually, here's a thread regarding command line options, basically same issue, w/o a resolution though...

http://lists.apple.com/archives/web-dev/2003/Dec/msg00177.html

I'd be ok with Firefox as well, I guess, but I'd like it to work w/ Safari.

Digging...

tloring
12-02-2004, 11:23 AM
I have Safari working for the Run...but not Preview.

In order to fire up Safari, in the Laszlo Preferences for Web Browser Location, use: /usr/bin/open

I tried it as "/usr/bin/open -a Safari", but it didn't like it as it's looking for a full path and there's no option for parameters (like the general version). Anyway, it defaults to Safari nontheless when it executes.

I tried the same for the General Web Browser location (both w/ and w/o parameters "-a Safari"), but that did not help with Preview (nor I guess would I expect it to I guess).

Anyone w/ Mac OS X have Preview working?
Thom

peller
12-02-2004, 02:12 PM
I'm sorry. I attempted to document all of this somewhere, though even I'm not sure where it ended up! Our support for the Macintosh in the initial release is limited. Here are the tips you need to get running (it sounds like you've already figured most of this out the hard way)

1) On the Mac, we don't support compilation from within Eclipse, and therefore do not support the preview tab (yet) and error markers do not yet work either. You can still edit, deploy, and debug applications, though it does all seem a bit slow on the Mac. I'd very much like to hear your feedback once you get things running.

2) To launch, you need to provide an expression for "browser" in the Laszlo preferences for which our code can say "xxx url" in the shell, where xxx is the string you provide. The only combination I've found which works is to say "open" and use Safari that way. The chooser widget, for Mac and Eclipse reasons which are still not clear to me, treat the application directory as an endpoint and don't let you browse to the actual executable. Safari doesn't seem to be able to take a URL as an argument anyway! Firefox will launch, but will not work with the debugger for other reasons which aren't entirely clear. I haven't tried any other browsers.

Please feel free to follow up to the forum on alphaWorks for anything specific to the IDE for Laszlo.

Thanks,

Adam Peller
IBM Emerging Technologies

tloring
12-02-2004, 03:15 PM
Ahh...thanks, I won't beat my head anymore about the the Preview...I suspected there must be some issue there in general.

I actually thought I had read the Readme.txt - I must have just read the install index.html! Dang, I see right there now: "the Mac is not supported, but will work with some limitations, such as no preview window, and no compile support...". I beat my head against the wall because it feels so good when I stop.

The fact that it can be Run from w/i the IDE at least helps, though it is indeed slow. In fact, I was hoping that getting a Preview if ever would be faster.

Yes, "open" works, and by default an app here opens in Safari, luckily since one cannot provide parameters to the expression.

In the Mac world, the application is /Applications/Safari.app, that's it, so the Chooser works as expected; the fact that an .app is really a directory structure of components and resources etc. is hidden from the average user 'cause they wouldn't know what to do with it.

The proper way to execute these apps from the shell is with 'open -a <app_path> <args>', where shortcuts such as Safari work for app_path. You can also exec the actual executable, but as you noted, it doesn't accept args - definitely a shortcoming in general.

I'm generally not a fan of IDE's, I find they tend to get in the way sometimes, though this seems fairly nice, however without a Preview mode, and performance factors, not sure how practical it is at this point. But it's certainly a nice preview of what I hope will be full Mac support!

Thanks!
Thom