下载了eclipse groovy plugin,成功安装后准备写一个hello
world,发现了两个问题。
?
1. 第一个问题是这样的。参看这个网页。
网页中提到需要将eclipse java project的default output
folder设置为bin-groovy。详细描述见下面英文。
Create a Groovy
Project
To create a basic Groovy project in Eclipse perform the
following steps:
- Go to: File -> New -> Project
- Select Java Project and press Next
- In the Project Name field enter the name of your project
(GroovyJava for this example)
- Under Project Layout select Create separate source
and output folders and press Finish
- In the Package Explorer find the newly created project,
right click, and select Groovy -> Add Groovy
Nature
So far you should have a src folder, a bin-groovy
folder, and several libraries. There is also a bin folder
that was created by Eclipse, but is hidden due to exclusion
filters. The next steps are needed to make the bin-groovy
folder the default output folder, and to connect it to the
src folder so that the debugger will know where to find the
associated source and classes:
- In the Package Explorer, right click on the "GroovyJava"
project, and select: Build Path -> Configure Build
Path
- Select the Source tab and then use the Browse
button to change the Default Output Folder from bin
to bin-groovy
- Press OK, OK
This will expose the bin folder in the Package
Explorer. I'm not sure why the plugin creates a
bin-groovy directory. Perhaps there are other "bin" files
that are best kept separate from the Groovy classes, or perhaps one
of the original versions of Eclipse didn't create a "bin" directory
automatically. Some day when someone has a clear idea of the
usefulness of this, or lack thereof, we can clean up my
instructions.
?
2.
第二个问题是插件的问题。写了一个简单的脚本后,运行的时候会抛出异常。
这是因为在点击【右键工程文件夹-->Groovy-->Import Groovy Libs into
Project】按钮的时候,并没有将Groovy需要的jar包拷贝到工程的classpath中,手动将%Groovy_home%/lib路径下的jar包拷贝到工程中,并设置为classpath。运行hello
world,一切搞定!~
分享到:
相关推荐
最简单的hello world基于 Groovy 和 Ubuntu 12.04 LTS.
史上最全的50多种常用的不同语言、工具Hello World示例代码 文件后缀名 描述 .applescript 苹果公司开发的一种脚本语言 .asp ASP 是微软开发的在服务器端脚本环境 .aspx ASPX 是微软的在服务器端运行的动态网页文件 ...
cd scala && scala helloWorld.scala && cd .. cd clojure && lein hello-world && cd .. cd ceylon && ceylon compile de.olofsson && ceylon run de.olofsson && cd .. cd fantom && fan hello_world.fan && cd ..
groovy-common-extensions.zip,groovy 2+的扩展集合。
这个Github公共存储库包含用所有计算机语言编写的Hello World程序。 电脑语言 //文件扩展名| 电脑语言 ABAP | 高级业务应用程序编程 ADA | Ada高级编程语言 英美烟草| 批 高炉| Brainfuck神秘编程语言 C | C计算机...
java asm源码SmartASMifier 将Java源代码编译为ASM源代码(或字节码作为文本)的实用程序 ...jsrc/HelloWorld.java jsrc/HelloWorld2.java 显示字节码: ./asmify.sh -b jsrc/HelloWorld.java jsrc/HelloWorld2.java
要运行,请输入gradle bootRun 要输入,请输入:curl 您将收到“ Hello World”问候: 你好,世界! 现在,从“ hello.featurex.Dependency.message”开始,如果您编辑消息并将其更改为Hello,world2! 并做卷曲 您...
hello-world-groovy示例是用Groovy编写的简单Hello World实现。 要使用Gradle运行应用程序,请使用: $ cd hello-world-groovy $ ./gradlew run 然后转到 你好世界科特琳 hello-world-kotlin示例是用Kotlin编写的...
world. ”这恰恰是1987年中国第一封电子邮件的内容。 始终选择最简单的实施方法。 在同一文件夹中保留相同的语言。 仅附加源代码。 附加新语言后,将编译命令添加到Makefile (可选)。 因此,这就是我们要做的。 ...
Seam - 语境相关的组件[满江红20071230]............................................................................................................................ 1 Java EE 框架...........................
3.5. Groovy Bean Definition DSL .............................................................................. 18 3.6. Core Container Improvements ........................................................
3.5. Groovy Bean Definition DSL .............................................................................. 18 3.6. Core Container Improvements ........................................................
excel类别 一个小实用程序,可轻松使用 groovy 制作 Excel 文件。 它只是 Apache POI 上的一个薄包装。... groovy -cp build/libs/excelcatgory.jar -e 'new ExcelBuilder().build { row { cells("hello","world") }
JVM Lambda模板该项目具有针对Scala,Groovy和Java的hello world lambda函数,并且均配置了gradle和集成测试源集该项目有一个SAM yaml(application.yaml),并配置了 ,它将为您提供3种可运行的“ hello world” ...
使用容器化应用 这是一个示例,说明如何使用Jib轻松为构建Docker映像。 在了解有关Jib的更多。...> Hello World 给它一个 使用Kubernetes IMAGE= ./gradlew jib --image= $IMAGE kubectl run m
' Hello World! ' } runServer() @Grab ( group = ' commons-lang ' , module = ' commons-lang ' , version = ' 2.6 ' ) import static graffias.* import org.apache.commons.lang.StringEscapeUtils get( ' / '...
3.1 Spring Boot CLI groovy版Hello World 3.2常规Java版Hello World 4.1 application.properties 4.2 Spring Boot属性配置和使用 4.2.1配置的优先级 4.2.2命令行参数配置 4.2.3 random。*属性配置
#TTPOD REST CoC理念的一套HTTP JSON API框架... " ] }} 打开 { " code " : 1 , " data " : " Hello, World ! " } 就这样 !!! 主要公约如您所见, my是Controller Name(第一个小写字母), hello是方法Name。这是Ma
使用BeanPostProcessor的Hello World示例 3.7.1.2. RequiredAnnotationBeanPostProcessor示例 3.7.2. 用BeanFactoryPostProcessor定制配置元数据 3.7.2.1. PropertyPlaceholderConfigurer示例 3.7.2.2. ...
HelloWorld“你好,世界!” 在每种编程语言中。 当前列表Bash Dart Go Groovy HTML Haskell Java Julia Kotlin PHP Perl Python Ruby Rust Scala请求 贡献拉取请求欢迎所有拉取请求! 如果您想添加一种语言,请执行...