更新环境变量:

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. 初识Dubbo 系列之4-Dubbo 依赖

    依赖 必需依赖 JDK1.5+ 理论上Dubbo能够仅仅依赖JDK,不依赖于不论什么三方库执行,仅仅需配置使用JDK相关实现策略. 缺省依赖 通过mvn dependency:tree > de ...

  2. open sql 更新数据

    insert语句: 1.插入单行数据有两种方法:wa是一个工作区 insert into dbtab values wa. insert into dbtab from wa. 该语句也可以将数据行插 ...

  3. ruby语言仅仅是昙花一现

    Ruby语言本身存在非常久了,在国内一直没火过.非常多人仅仅是知道有这样的语言,会的人少之又少.不论什么一种语言坚持十来年的发展,变得越来越好,一定有它不平常的地方.不能任意的去比較语言本身的好与坏. ...

  4. javascript (六) 引用外部js文件

    外部的 JavaScript 也可以把脚本保存到外部文件中.外部文件通常包含被多个网页使用的代码. 外部 JavaScript 文件的文件扩展名是 .js. 如需使用外部文件,请在 <scrip ...

  5. 后缀数组--可重叠的K次最长重复子串(POJ3261)

    题目:Milk Patterns #include <stdio.h> #include <string.h> #define N 1000010 int wa[N],wb[N ...

  6. Binders 与 Window Tokens(窗体令牌)

    原文地址:http://www.androiddesignpatterns.com/2013/07/binders-window-tokens.html 安卓的一项核心设计思想是希望能提供一个不须要依 ...

  7. 蜘蛛侠天堂,打死我mac键盘

    今天是周末,在我租住的房间,以一个离奇事件. 一个蜘蛛侠天堂,趴在我的假期车窗玻璃,爬下沿着玻璃.特别糟糕.可以飞檐走壁. 可惜体力不支,摔死在我的mac键盘上. 有图有视频. 视频链接:http:/ ...

  8. Androidproject夹

    创建一个Android应用 File -> New -> Android Application Project 填写应用名称.project名称.包名 设置project的相关信息.默认 ...

  9. [c++语法]类

    什么是类 类 是 面向对象的基础.c里面是没有对象的,只有数据,即静态的死物. 从面向过程升级到面向对象后,有了对象的概念,对象是数据与方法的合体,是动态的活物. 类代表着一类事物的特征.而对象,是类 ...

  10. Codeforces325-B(二分搜索)

    题目:B. Stadium and Games 分析:问题可以转化为下面的等式求解问题: 由于n在10^18范围内,所以k的范围是从0到63即可,这样就可以枚举k,二分m,然后所有符合条件的就是答案了 ...