my First groovy

本文详细介绍如何在Eclipse环境中安装Groovy插件,包括通过自动更新安装和手动下载安装两种方式,并指导如何创建Groovy项目及编写Groovy文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1 下载 groovy in Eclipse

(1) 可以采用 Eclipse 中的自动更新。

Update Site The update site containing the most recent release is here: http://dist.codehaus.org/groovy/distributions/update/

Go to: Help -> Software Updates -> Find and Install -> Search For New Features

Click on New Remote Site

Enter a name (eg: Groovy) in the Name field

Copy the URL from above into the URL field and press OK

Check the new Groovy repository and press finish

Under Select the Features to Install check the Groovy check box (be sure to get the latest version) and press Next Accept the agreement and press Next

If the default location looks okay press Finish (this will download the plugin)

If you get a warning that the plugin is unsigned click Install or Install All

(2) 或者直接 打开 http://dist.codehaus.org/groovy/distributions/update/

下载 目录 features 和 plugins 的文件,并它们分别复制到 eclipse 安装目录下的 features 和 plugins ,然后重启eclipse 便可

2 新建一个 java 项目

选中该 java 项目,右键 菜单 ——》 groovy ——》 add groovy nature 。

设置 groovy 的编译输出目录

选中新建的项目,右键 构造路径——》配置构造路径  

  • 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

3 编写 groovy 文件

选中项目 右键 , new ——》 other

选择 groovy ——》 groovy class 便可

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值