Groovy interpreter is built atop JVM. I made some Java libraries for JVM and some functions in the library will be called when running groovy scripts. Unfortunately, some error happens.
Therefore, I tried to launch groovy interpreter in the eclipse, so that I can set breakpoints in my code and debug the issue.
Therefore, what I have done is:
First, I run the script in linux using
groovy --indy ackermann.groovy 2
and then usingps
to show the detail parameters. What I got is something like:/homes/sxu3/298182/bin/java -Xbootclasspath/p:/homes/sxu3/tools/jars/asmInliner-4.0.1.jar:/homes/sxu3/tools/jars/invoke.jar:/homes/sxu3/tools/jars/asm-all-5.0.3.jar:/homes/sxu3/tools/jars/common-4.0.1.jar:/homes/sxu3/tools/jars/logback-classic-1.1.3.jar:/homes/sxu3/tools/jars/logback-core-1.1.3.jar:/homes/sxu3/tools/jars/slf4j-api-1.7.7.jar:/homes/sxu3/tools/jars/conf/ -classpath /homes/sxu3/bin/groovy-2.4.8/lib/groovy-2.4.8.jar -Dscript.name=/homes/sxu3/bin/groovy-2.4.8/bin/groovy -Dprogram.name=groovy -Dgroovy.starter.conf=/homes/sxu3/bin/groovy-2.4.8/conf/groovy-starter.conf -Dgroovy.home=/homes/sxu3/bin/groovy-2.4.8 -Dtools.jar=/homes/sxu3/298182/lib/tools.jar org.codehaus.groovy.tools.GroovyStarter --main groovy.ui.GroovyMain --conf /homes/sxu3/bin/groovy-2.4.8/conf/groovy-starter.conf --classpath . --indy ackermann.groovy 2
- In eclipse, I create a
run configuration
>Java application
> new. The main class is:org.codehaus.groovy.tools.GroovyStarter
and the VM Arguments:
-Dscript.name=Y:\bin\groovy-2.4.8\bin\groovy -Dprogram.name=groovy -Dgroovy.starter.conf=Y:\bin\groovy-2.4.8\conf\groovy-starter.conf -Dgroovy.home=y:\bin\groovy-2.4.8 -Dtools.jar=Y:\298182\lib\tools.jar --main groovy.ui.GroovyMain --conf Y:\bin\groovy-2.4.8\conf\groovy-starter.conf -classpath . --indy
and the "Program Arguments":
Y:\bin\indy-benchmark-suite_orig\programs\groovy\ackermann.groovy 300
3 Add my libraries to the VM bootstrap and classpath.
After clicking the Run
in the debug configuration
, I got errors below:
JVMJ9VM007E Command-line option unrecognised: --main
The trick is at groovy's groovy.sh script, which launches a Java process. Therefore, I am looking whether some people can help solve it. Also how interpreter developers debug during development.