更新环境变量:

source /etc/profile

验证是否成功:

# groovy -version
Groovy Version: 2.3.6 JVM: 1.7.0_67 Vendor: Oracle Corporation OS: Linux

打开groovyConsole:

4)、使用IDE进行开发(这里以Intellij idea 13.1为例)

1. Enable the plugin

Before you create your first Groovy application make sure Groovy plugin is enabled in Settings → Plugins.

2. Create a new project

Open Project Wizard and select Scala template. Since Groovy requires Java you have to specify the Project SDK.

If you create a Groovy project for the first time IntelliJ IDEA will offer you to create Groovy SDK library. Press Create button and choose directory with a Groovy SDK.

The IDE will create an empty project.

3. Create a new class

The easiest way to create Groovy class or script is to use Ctrl + N shortcut from Project View or Navigation Bar.

Choose between class, interface, enum and annotation with Up and Down arrows.

Let's create a class with a method returning 'Hello, world!' string.

4. Create a new script

Now we can create a script file via Ctrl + N shortcut.

Choose between script and GroovyDSL script with Up and Down arrows.

Now we can create an instance of our class and invoke hello method.

5. Run the project

In order to run the application you can manually create a Run configuration via Run → Edit configurations or run the active script automatically by pressing Ctrl + Shift + F10 shortcut.

使用Groovy Shell :

打开Tools-->Groovy Shell...

使用Groovy Console :

打开Tools-->Groovy Console...

http://www.it165.net/os/html/201409/9276.html

IntelliJ IDEA Groovy(转)的更多相关文章

  1. Groovy 配置环境变量

    转载请标明出处:http://blog.csdn.net/zhaoyanjun6/article/details/70313790 本文出自[赵彦军的博客] 概念 Groovy 配置环境变量 开发工具 ...

  2. 30分钟groovy快速入门并掌握(ubuntu 14.04+IntelliJ 13)

    本文适合于不熟悉 Groovy,但想快速轻松地了解其基础知识的 Java开发人员.了解 Groovy 对 Java 语法的简化变形,学习 Groovy 的核心功能,例如本地集合.内置正则表达式和闭包. ...

  3. Configuring Groovy SDK within IntelliJ IDEA

    一.原因 IntelliJ IDEA期待一个the standard Groovy SDK    二.解决方案: 下载安装Groovy就可以了   官网下载地址: http://groovy-lang ...

  4. 利用IntelliJ IDEA创建第一个Groovy工程

    因为某些原因,需要学习一下Groovy.关于Groovy的入门教程请看这篇文章http://www.ibm.com/developerworks/cn/education/java/j-groovy/ ...

  5. IntelliJ IDEA 内存优化最佳实践

    本文作者在和同事的一次讨论中发现,对 IntelliJ IDEA 内存采用不同的设置方案,会对 IDE 的速度和响应能力产生不同的影响. Don't be a Scrooge and give you ...

  6. 【IDEA】intellij idea 插件推荐

    CSDN 2016博客之星评选结果公布    [系列直播]零基础学习微信小程序!      "我的2016"主题征文活动   博客的神秘功能 [IDEA]intellij idea ...

  7. [转]IntelliJ IDEA 使用心得与常用快捷键

    IntelliJ IDEA 使用心得与常用快捷键 那种酸爽,根本说不出来—————————————————————————— by: Jimi没有BondJimi是谁? 就是洒家啊! 刚开始学习写Ja ...

  8. Atitit intellij idea的使用总结attilax

    Atitit intellij idea的使用总结attilax 1. ideaIC-2016.2.4.exe1 1.1. Ij vs eclipse市场份额1 1.2. Ij的优点(方便的支持gro ...

  9. IntelliJ IDEA 使用总结[zz]

    本文转自:http://cowboy-bebop.iteye.com/blog/1035550,仅做稍微整理,转载请注明出处. 1. IDEA内存优化 因机器本身的配置而配置: \IntelliJ I ...

随机推荐

  1. 手机SIM卡无法识别解决方案

    SIM卡是工作中测试用的,经常插拔到不同的手机,前两天SIM卡放到手机中都能正常识别,今天插入到另一款手机中发现无法识别.心里糟了,是不是卡坏了,根据之 前的直觉,在公司找了一块橡皮,在SIM卡的芯片 ...

  2. cp命令的实现

    #include <unistd.h> #include <fcntl.h> #include <stdlib.h> #define BUFFERSIZE 4096 ...

  3. java.util.Queue用法

    队列是一种特殊的线性表,它只允许在表的前端(front)进行删除操作,而在表的后端(rear)进行插入操作.进行插入操作的端称为队尾,进行删除操作的端称为队头.队列中没有元素时,称为空队列. 在队列这 ...

  4. TMsgThread, TCommThread -- 在delphi线程中实现消息循环(105篇博客,好多研究消息的文章)

    在delphi线程中实现消息循环 在delphi线程中实现消息循环 Delphi的TThread类使用很方便,但是有时候我们需要在线程类中使用消息循环,delphi没有提供.   花了两天的事件研究了 ...

  5. MySQL :: MySQL 5.0 Reference Manual :: 14.4 The MEMORY (HEAP) Storage Engine

    MySQL :: MySQL 5.0 Reference Manual :: 14.4 The MEMORY (HEAP) Storage Engine The MEMORY (HEAP) Stora ...

  6. csdn的登录框好难看

    不好意思说实话了,新的登陆框样式挺难看的,那种橙不明朗,介于黄和橙之间,跟整个网站主色调红和黑很不搭.不过,倒是有点跟风Win8平实的style,但是比Win8更简陋了点. tooltip要不加都不加 ...

  7. uva 10581 - Partitioning for fun and profit(记忆化搜索+数论)

    题目链接:uva 10581 - Partitioning for fun and profit 题目大意:给定m,n,k,将m分解成n份,然后依照每份的个数排定字典序,而且划分时要求ai−1≤ai, ...

  8. 窗体透明,但窗体上的控件不透明(简单好用)good

    1.在Delphi中,设置窗体的AlphaBlend := true;AlphaBlendValue := 0-255; AlphaBlendValue越小窗体的透明度就越高.这种方法将会使窗体和窗体 ...

  9. 96 Stocks APIs: Bloomberg, NASDAQ and E*TRADE

      Our API directory now includes 96 stocks APIs. The newest is the Eurex VALUES API. The most popula ...

  10. 空间参考系统与WKT解析

    空间参考系统与WKT解析 1.为什么要空间参考系统? 空间参考系统,也称为坐标系统.在GIS中为地理数据定位的基准,假设给你一个坐标(442281.875,4422651.589).如果不给你空间参考 ...