I can't run or debug Groovy scripts in IntelliJ. I'm getting the error: Error: Could not find or load main class org.codehaus.groovy.tools.GroovyStarter
. Running scripts from cmd works propertly (I'm using groovyc and groovy command).
import org.apache.pdfbox.pdmodel.PDDocument
import org.fit.pdfdom.PDFDomTree
import org.w3c.dom.Document
// load the PDF file using PDFBox
PDDocument pdf = PDDocument.load(new java.io.File("file.pdf"))
// create the DOM parser
PDFDomTree parser = new PDFDomTree()
// parse the file and get the DOM Document
Document dom = parser.createDOM(pdf)
To run a Groovy script, from the context menu in the editor, select Run 'name' Ctrl+Shift+F10 .
The Groovy plugin is bundled with IntelliJ IDEA and enabled by default. IntelliJ IDEA supports the latest stable version of Groovy and Groovy 4 syntax.
I missed https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-all/2.4.12 depedency in my pom.xml file. Bug is resolved. Thanks All for your hints :)
Create Run Configuration
(⌘N), and set the Module
to the Module that contains all of your dependencies.
I had had the same problem until I did the next:
After all, I can run/debug my scripts from IDEA
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With