The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg

The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg

Author:Benjamin J. Evans Martijn Verburg
Language: eng
Format: epub

3. Save HelloGroovy.groovy.

4. Compile the file by executing this command:

groovyc HelloGroovy.groovy

5. Run it by executing this command:

groovy HelloGroovy

Tip

You can skip the compile step if the Groovy source file is in your CLASSPATH. The Groovy runtime will execute groovyc on the source file first if need be.

Congratulations, you’ve run your first line of Groovy code!

Just like Java, you can write, compile, and execute Groovy code from the command line, but that quickly becomes unwieldy when dealing with things such as the CLASSPATH. Groovy is well supported by the major Java IDEs (Eclipse, IntelliJ, and NetBeans) but Groovy also provides a useful console for you to run code in. This console is ideal if you’re quickly trying to script up a solution or prototype a small piece of code, as it’s much faster to use than a full-fledged IDE.



Loading...
Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Web Analytics