Could use some assistance trying to run the rhino shell in the vscode java debugger after the switch to modules #1589
Replies: 4 comments 1 reply
-
I don't have a comment other than to say me too -- the "rhino" module works
great in VS Code but unfortunately other modules don't compile. All I could
find on line about this were a few comments along the lines of, "oh yeah,
VS code and modules don't work well." Perhaps someone else has more VS code
experience or works in that community and can see if we're doing something
wrong.
…On Sun, Aug 25, 2024 at 2:26 PM Tony Germano ***@***.***> wrote:
It used to be pretty straight forward if I tried to start the debugger on
the org.mozilla.javascript.tools.shell.Main class. Now I get the error
below in the terminal, and I'm not sure what to do to get it to work. I'm
about ready to resort to println debugging 😛
cd /home/agermano/projects/rhino ; /usr/bin/env /home/agermano/.sdkman/candidates/java/17.0.8.fx-zulu/bin/java -agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:36463 @/tmp/cp_c17n1f7pxsbsq6nfhl7vh72nk.argfile -m org.mozilla.rhino.tools/org.mozilla.javascript.tools.shell.Main
Error occurred during initialization of boot layer
java.lang.module.FindException: Module org.mozilla.rhino not found, required by org.mozilla.rhino.tools
—
Reply to this email directly, view it on GitHub
<#1589>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAD7I2ZIBGERDUATFZ7UFELZTJDZZAVCNFSM6AAAAABNC34JECVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZXGA4TINJRGI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
@tonygermano just going of of the error message you posted, I think you need to provide a module path argument to the commandline string you're executing to launch the shell |
Beta Was this translation helpful? Give feedback.
-
I made some progress by adjusting my launch.json. It's still not 100% working, but probably good enough for most. This entry was generated automatically from the Gradle project, and I modified it. It would probably make sense to rename it to something easier to identify since there are 4 "Main" classes in the whole project. {
"type": "java",
"name": "Main(2)",
"request": "launch",
"mainClass": "org.mozilla.rhino.tools/org.mozilla.javascript.tools.shell.Main",
"projectName": "rhino-tools",
"shortenCommandLine": "none",
"args": "-version 200",
"modulePaths": ["$Auto", "${workspaceFolder}/rhino/bin/main", "${workspaceFolder}/rhino-xml/bin/main"]
}, This was another attempt for which E4X is working in the shell, and it will break on the breakpoints, but it won't let me step or observe any values, and tells me that "model is not available for rhino." {
"type": "java",
"name": "Rhino-all Shell",
"request": "launch",
"mainClass": "org.mozilla.javascript.tools.shell.Main",
"projectName": "rhino-all",
"shortenCommandLine": "none",
"args": "-version 200",
"sourcePaths": ["${workspaceFolder}/rhino/src/main/java"]
}, Telling it to use "rhino-all" as the |
Beta Was this translation helpful? Give feedback.
-
I've been using this, and it lets me launch the shell and debug. However, VS Code still doesn't work properly for me, in that for every module other than "rhino," it reports all the imports from other modules as "the type is not accessible." That means that I can not use the IDE effectively for any module other than the base "rhino" module. I wonder if others have that problem? In any case, here is my version of a configuration that at least works:
|
Beta Was this translation helpful? Give feedback.
-
It used to be pretty straight forward if I tried to start the debugger on the
org.mozilla.javascript.tools.shell.Main
class. Now I get the error below in the terminal, and I'm not sure what to do to get it to work. I'm about ready to resort to println debugging 😛Beta Was this translation helpful? Give feedback.
All reactions