intellij-idea - 在 IntelliJ 中运行 Groovy 脚本失败

标签 intellij-idea groovy

我无法在 IntelliJ 中运行或调试 Groovy 脚本。我收到错误:错误:无法找到或加载主类 org.codehaus.groovy.tools.GroovyStarter。从 cmd 运行脚本可以正常工作(我正在使用 groovyc 和 groovy 命令)。

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)

最佳答案

我错过了https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-all/2.4.12我的 pom.xml 文件中的依赖项。错误已解决。谢谢大家的提示:)

关于intellij-idea - 在 IntelliJ 中运行 Groovy 脚本失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44433417/

相关文章:

intellij-idea - intellij 是否可以像在 Eclipse 中那样组织导入?

maven - 使用 Intellij IDEA 与其他开发人员共享 Maven 运行配置

grails - MarkupBuilder呈现HTML SELECT元素

groovy - 带有@Field批注的Groovy 2.4变量范围

groovy - Jmeter中JedisPool的使用方法

groovy - 如何在 Groovy 中将查询字符串转换为 Map

version-control - 无法在 IntelliJ 12.1.4 中从 TFS 服务器提取架子

java - 在 Java 项目中查找重复常量

intellij-idea - 在命令行中运行 IntelliJ IDEA 代码覆盖率

jenkins - 在 Jenkins 从属设备上使用 CURL 下载 zip 文件时无法创建文件