shengqi158 / OnJava8-Examples

Code Examples for the book "On Java 8"

Home Page:http://www.OnJava8.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

To compile and run these programs, you only need JDK 8 installed. Invoking gradlew will automatically download and install Gradle. Gradle will also install all additional libraries necessary to compile and run the Java examples in the book.

To compile and run everything, the command is:

gradlew run

If you are on a Unix/Linux based system, you must select the local directory for all commands, for example:

./gradlew run

To only compile everything, the command is:

gradlew compileJava

To compile only a single chapter (including dependencies), use for example:

gradlew :strings:compileJava

To run only a single chapter, say:

gradlew :strings:run

Gradle can also be used to run a single program. Here, we run the ReplacingStringTokenizer.java program in the strings chapter subdirectory:

gradlew :strings:ReplacingStringTokenizer

However, if the file name is unique throughout the book (the majority are), you can just give the program name, like this:

gradlew ReplacingStringTokenizer

Note that all commands are run from the base directory where the example code is installed, and where you find the gradlew script.

You can learn about other options by just typing gradlew with no arguments.

About

Code Examples for the book "On Java 8"

http://www.OnJava8.com

License:Other


Languages

Language:Java 98.4%Language:Groovy 0.8%Language:C++ 0.3%Language:Python 0.3%Language:Go 0.2%Language:Batchfile 0.0%