Beanshell script from the Command Line

Robert Schwenn <[email protected]> Thu, 3 Oct 2024 22:08:38 +0200
Newsgroups gmane.editors.jedit.user
Message-ID <[email protected]>
--===============8844511176416389432==
Content-Language: en-US
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html>
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><font face="monospace">Hi folks,</font></p>
    <p><font face="monospace">I have a program which creates a Beanshell
        script and runs it via calling jedit with -run option. The
        script depends on a loaded plugin. Also, it uses jedit's status
        line for showing progress (it may take it a while). So,
        obviously jedit has to be finished startup before </font><font
        face="monospace">the script is run</font><font face="monospace">.</font></p>
    <p><font face="monospace">jEdit 5.7 User's Guide, chapter 15,
        "Running Scripts from the Command Line" states, that <i>VFSManager.runInAWTThread()</i>
        has to be used in this case. And it used to work for many years,
        at least up to jEdit 5.3. </font></p>
    <p><font face="monospace">But with jEdit 5.6 an error occurs: "<i>[AWT-EventQueue-0]
          [error] AwtRunnableQueue$RunRequestsInAWTThread:
          java.lang.reflect.InaccessibleObjectException: Unable to make
          public java.lang.AbstractStringBuilder
          java.lang.AbstractStringBuilder.append(java.lang.String)
          accessible: module java.base does not "opens java.lang" to
          unnamed module @6b2fad11</i>", though I invoke jedit 5.6 with
        command line option "<i>--add-opens
          java.base/java.lang=ALL-UNNAMED</i>".</font></p>
    <p><font face="monospace">jEdit 5.7 doesn't provide </font><font
        face="monospace"><i>VFSManager.runInAWTThread()</i></font><font
        face="monospace"> anymore (see changes.txt).<br>
      </font></p>
    <p><font face="monospace">You guess my question: Is there a way to
        achieve the behavior of old </font><font face="monospace"><i>VFSManager.runInAWTThread()</i></font><font
        face="monospace">, hence run the script given at command line
        after jedit startup has been completed?<br>
      </font></p>
    <p><font face="monospace">Cheers,<br>
        Robert<br>
      </font></p>
  </body>
</html>


--===============8844511176416389432==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============8844511176416389432==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-- 
-----------------------------------------------
jEdit Users' List
[email protected]
https://lists.sourceforge.net/lists/listinfo/jedit-users

--===============8844511176416389432==--