Size: 356
Comment:
|
Size: 1070
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 5: | Line 5: |
== Install == {{{#!highlight bash cp apache-groovy-binary-3.0.3.zip ~/ cd ~/ unzip apache-groovy-binary-3.0.3.zip nano ~/.bashrc # export GROOVY_HOME=$HOME/groovy-3.0.3 # PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/user/jdk-11.0.2/bin:/home/user/scripts # PATH=$PATH:/opt/mssql-tools/bin/:$GROOVY_HOME/bin # export PATH . ~/.bashrc groovysh # print("aaa") groovyConsole }}} == groovyc - compiler == * nano MyClass.groovy {{{ class X{ int amount } def x = new X() x.amount = 1 println("${x.amount}") }}} * groovyc MyClass.groovy * java -cp . -jar $GROOVY_HOME/lib/groovy-3.0.3.jar MyClass * java -jar $GROOVY_HOME/lib/groovy-3.0.3.jar MyClass |
Groovy
Apache Groovy is a powerful, optionally typed and dynamic language, with static-typing and static compilation capabilities, for the Java platform aimed at improving developer productivity thanks to a concise, familiar and easy to learn syntax
Install
1 cp apache-groovy-binary-3.0.3.zip ~/
2 cd ~/
3 unzip apache-groovy-binary-3.0.3.zip
4 nano ~/.bashrc
5 # export GROOVY_HOME=$HOME/groovy-3.0.3
6 # PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/user/jdk-11.0.2/bin:/home/user/scripts
7 # PATH=$PATH:/opt/mssql-tools/bin/:$GROOVY_HOME/bin
8 # export PATH
9 . ~/.bashrc
10 groovysh
11 # print("aaa")
12 groovyConsole
groovyc - compiler
nano MyClass.groovy
class X{ int amount } def x = new X() x.amount = 1 println("${x.amount}")