From the course: Gradle for Java-Based Applications and Libraries
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Compiling Java source code
From the course: Gradle for Java-Based Applications and Libraries
Compiling Java source code
- [Instructor] Part of your day-to-day workflow as a Java developer, is to create a modified Java source code to implement a feature or a bug fix. At some point of time, you will want to compile the code to ensure that it can be turned into bytecode. The Java plugin instantiates the task called compileJava. When executing the task, gradle will look for files with the extension .java in the directory src/main/java. The compiler will then compile the code with the Java version it can find on the system. Usually that's the Java distribution as indicated by the PATH environment variable. We can execute the task by running gardlew compileJava. As long as there are no issues with the source code, the compiler will produce the class files. Class files can be found in the output directory built classes. Another aspect of preparing runtime readiness for Java application, is to mix in the resource files with the class files so…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
(Locked)
Anatomy of a simple Java project2m 34s
-
(Locked)
Applying the Java plugin2m 37s
-
(Locked)
Compiling Java source code2m 49s
-
(Locked)
Packaging a JAR file2m 51s
-
(Locked)
Exploring the Java Application plugin3m 10s
-
(Locked)
Challenge: Generating Javadocs for a Java project1m 42s
-
(Locked)
Solution: Generating Javadocs for a Java project5m 25s
-
(Locked)
-
-
-