Running a Javascript Application from Java

54 views
Skip to first unread message

Max

unread,
Feb 13, 2011, 5:45:19 PM2/13/11
to Narwhal and Jack
Hi,

Sorry if my question sounds silly or obvious. Before I dive into it,
I would like to find out if Narwhal works for me. My scenario is
simple. I wan to use Java scripting (http://java.sun.com/developer/
technicalArticles/J2SE/Desktop/scripting/) to run applications built
using Narwhal.

Any suggestion?

Thanks,
Max.

Bryan A

unread,
Feb 25, 2011, 3:09:11 AM2/25/11
to Narwhal and Jack
Do you want a server back end using javascript or do you want a
desktop application?

Max

unread,
Feb 25, 2011, 7:24:10 PM2/25/11
to Narwhal and Jack
Well, not sure what difference it would make but I was looking at
embedding it within an OSGI container. There is so little input that
I'm quite desperate.

Kris Kowal

unread,
Feb 25, 2011, 7:29:35 PM2/25/11
to narw...@googlegroups.com
On Fri, Feb 25, 2011 at 4:24 PM, Max <max.bri...@gmail.com> wrote:
> Well, not sure what difference it would make but I was looking at
> embedding it within an OSGI container. There is so little input that
> I'm quite desperate.

I apologize for not responding. I've been working in other areas so
this isn't on the top of my mind. However, I did do several
brain-dumps on how Narwhal works that might be of use to you.

There's a section here on "Bootstrapping Narwhal", which describes how
Narwhal gets going. If you're running Narwhal in an OSGI container,
you'll have to replace all of the pieces up to the point where
narwhal.js gets executed. You could probably get some use out of the
Rhino engine's bootstrap.js, but it will likely have to be adapted to
receive information from alternate sources (it uses environment
variables to receive configuration from the shell scripts).

https://github.com/kriskowal/narwhal/blob/master/docs/narwhal.md

Kris Kowal

Bryan A

unread,
Feb 26, 2011, 2:00:06 PM2/26/11
to Narwhal and Jack
I got bootstrapping to work but it took a little trial and error. I
would check out
https://github.com/kriskowal/jack-servlet/blob/master/src/org/jackjs/JackServlet.java
It is a good template.

On Feb 25, 4:29 pm, Kris Kowal <kris.ko...@cixar.com> wrote:
Reply all
Reply to author
Forward
0 new messages