[jedit:bugs] #4118 BeanShell error: module java.base does not "opens java.lang" to unnamed module
"Björn Kautler" via jEdit-devel <[email protected]> Fri, 13 Oct 2023 22:33:14 -0000
| Newsgroups | gmane.editors.jedit.devel |
|---|---|
| Message-ID | </p/jedit/bugs/4118/4bc05841c0e5b019bbcea09def1e237597a6d875.bugs@jedit.p.sourceforge.net> |
Besides that jsr305 would not be any problem as I wrote on the mailing list, how do you think would making jEdit a JPMS module change anything? That would not magically make BeanShell be able to do that reflection. You would still need the `--add-opens` either way. And you can also use the `--add-opens` fine without making jEdit a JPMS module. As we build the `jedit.jar` as executable jar and only start it like that, we can even put those as `Add-Opens` attribute to the manifest of `jedit.jar` and it would work, without jEdit being a JPMS module.
But the bigger problem probably is, that those two are not exhaustive. They might fix this specific BeanShell snippet. But there are probably others? Potentially ever package in the JDK? I doubt we should or could add `Add-Opens` for the whole JDK world.
---
**[bugs:#4118] BeanShell error: module java.base does not "opens java.lang" to unnamed module**
**Status:** open
**Group:** Regressive (new to devel)
**Labels:** macro
**Created:** Fri Apr 22, 2022 04:03 PM UTC by blurredd
**Last Updated:** Sun Oct 08, 2023 07:56 PM UTC
**Owner:** nobody
I see the following BeanShell error when running a macro that appends to a StringBuilder:
```text
Sourced file: C:\Users\User\AppData\Roaming\jEdit\macros\StringBuilderTest.bsh unknown error: 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 @7c75222b : at Line: 2 :
in file: C:\Users\User\AppData\Roaming\jEdit\macros\StringBuilderTest.bsh
: sb .append ( "test" )
at org.gjt.sp.jedit.bsh.Interpreter.eval(Interpreter.java:696)
at org.gjt.sp.jedit.BeanShell._runScript(BeanShell.java:343)
at org.gjt.sp.jedit.BeanShell._runScript(BeanShell.java:291)
at org.gjt.sp.jedit.BeanShell.runScript(BeanShell.java:217)
at org.gjt.sp.jedit.Macros$BeanShellHandler.runMacro(Macros.java:1108)
at org.gjt.sp.jedit.Macros$Macro.invoke(Macros.java:530)
at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:343)
at org.gjt.sp.jedit.jEdit$3.invokeAction(jEdit.java:3417)
at org.gjt.sp.jedit.jEdit$3.invokeAction(jEdit.java:3399)
at org.gjt.sp.jedit.EditAction$Wrapper.actionPerformed(EditAction.java:225)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
...
```
StringBuilderTest.bsh:
```java
StringBuilder sb = new StringBuilder():
sb.append("test");
```
I'm using jEdit 5.6.0, java version 17.0.2 on Windows 10 Enterprise.
---
Sent from sourceforge.net because [email protected] is subscribed to https://sourceforge.net/p/jedit/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/jedit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
--
-----------------------------------------------
jEdit Developers' List
[email protected]
https://lists.sourceforge.net/lists/listinfo/jedit-devel