[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jedit-users
Subject:    Re: [ jEdit-users ] Superscript plugin with javascript (Rhino)
From:       "Alan Ezust" <alan.ezust () gmail ! com>
Date:       2008-04-25 22:40:49
Message-ID: f377591c0804251540r1e8e382fg9038c93bb7b8f0db () mail ! gmail ! com
[Download RAW message or body]

I didn't even know the SuperScript plugin worked. Nobody has touched
it in years.
I think superscript needs a new maintainer to update it against the
latest jars and plugins and jedit.


On Fri, Apr 11, 2008 at 2:42 AM, Villu Roogna <realmerx@gmail.com> wrote:
>  Hello to all users of this excellent editor
>
>  Trying to get SuperScript plugin to work with Rhino:
>
>  jEdit4.3pre13 with Java 1.6.0
>
>  - Downloaded Rhino 1.7R1 and put the jars js.jar and js-14.jar to
> ~/.jedit/jars
>  - Ran jedit from the shell (in order to get output to debug)
>  - Set superscript script mode to javascript and tried to run
> print("Hello"), no output in superscript plugin but shell displayed error
>
>
>  java.lang.NoSuchMethodError:
> org.mozilla.javascript.Context.getDebuggableEngine()Lorg/mozilla/javascript/debug/DebuggableEngine;
>
>  - googled and found that I probably should use newer bsf (2.4) (SuperScript
> has bsf 2.3 included and documentation also states that bsf 2.3+ can be
> used)
>  - downloaded newer bsf 2.4.0 and replaced the one in ~/.jedit/jars
>  - started jedit, it started but displayed error in shell:
>
>  7:24:47 PM [error] AWT-EventQueue-0: log4j:WARN No appenders could be found
> for logger (org.apache.bsf.BSFManager).
>  7:24:47 PM [error] AWT-EventQueue-0: log4j:WARN Please initialize the log4j
> system properly.
>
>  - tried javascript engine again and got output in superscript
>
>  org.apache.bsf.engines.javascript.JavaScriptEngine
>
>  - also beanshell engine in superscript did not worked anymore (worked fine
> with superscript included bsf 2.3) and output to superscript window:
>
>  bsh.util.BeanShellBSFEngine
>
>  - googled and found out that bsf 2.4.0 needs new common-logging.jar from
> apache commons, downloaded it (commons-logging-1.1.1.jar) and placed in
> ~/.jedit/jars
>
>  - no change still the error in shell and superscript engines fail to work
>  - decided to try some manual java trickery:
>
>  loaded jedit like this:
>
>  java -cp
> jedit.jar:commons-logging-1.1.1.jar:bsf.jar:bsh-2.0b4.jar:js.jar:js-14.jar
> org.gjt.sp.jedit.jEdit
>
>  (in actual command correct jar paths of course were used)
>
>  - that way I got no errors on startup, beanshell engine worked in
> superscript but rhino javascript (ran print("Hello") still failed
> displaying:
>
>  ReferenceError: "print" is not defined.
>
>  and shell displayed:
>
>  7:49:35 PM [error] SuperScriptPlugin: JavaScript Error: Internal Error:
> org.mozilla.javascript.EcmaError: ReferenceError: "print" is not defined.
>  7:49:35 PM [error] SuperScriptPlugin: org.apache.bsf.BSFException:
> JavaScript Error: Internal Error: org.mozilla.javascript.EcmaError:
> ReferenceError: "print" is not defined.
>
> - Did some more googling and found that print is feature of rhino js shell
> and not part of Rhino engine
>
>  so I wrote small (and stupid ) script to test out rhino with bsf and it was
> evaluated correctly (the array comprehensions stuff is just to see if
> javascript 1.7 features work correctly).
>
>  testf();
>
>  testf = function() {
>  var arr = [i for each (i in ['first','second','last']) if (i != 'second')];
>  for each (el in arr) {
>  print(el);
>  }
>  }
>
>  function print(message) {
>  java.lang.System.out.println(message);
>  }
>
>
>  But this is not acceptable solution since I manually have to include all
> the engines that I want to use. So how can I get it to work without having
> to specify engines manually?
>
> All the best,
> Villu
>
> -------------------------------------------------------------------------
>  This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
>  Don't miss this year's exciting event. There's still time to save $100.
>  Use priority code J8TL2D2.
>
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> --
>  -----------------------------------------------
>  jEdit Users' List
>  jEdit-users@lists.sourceforge.net
>  https://lists.sourceforge.net/lists/listinfo/jedit-users
>
>

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
-- 
-----------------------------------------------
jEdit Users' List
jEdit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic