Module java

The java module contains the properties and rules for building Java projects.

Java Properties

PropertyTypeSinceDefaultDescription
additionalClassPathsstringList1.4undefinedLocations beside this product's class output path to consider when compiling.
additionalCompilerFlagsstringList1.4undefinedUse this to supply compiler flags not covered by any of the properties in this module.
additionalJarFlagsstringList1.4undefinedUse this to supply archiver flags not covered by any of the properties in this module.
bootClassPathsstringList1.4undefinedUse this if you need to specify non-standard bootstrap class files.
compilerFilePathstring1.4compilerName, prefixed by jdkPath if it is definedThe command to invoke when compiling Java sources.
compilerNamestring1.4"javac"The file name of the Java compiler.
enableWarningsbool1.4trueControls whether warnings are emitted when compiling Java sources.
interpreterFilePathstring1.4interpreterName, prefixed by jdkPath if it is definedThe command to invoke when executing Java code.
interpreterNamestring1.4"java"The file name of the Java interpreter.
jarFilePathstring1.4jarName, prefixed by jdkPath if it is definedThe command to run when creating or extracting jar files.
jarNamestring1.4"jar"The file name of the jar tool.
jdkIncludePathspathList1.4.1determined automaticallyList of include paths for native header files. Applications using JNI to interface with native code should add these paths to cpp.includePaths.
jdkPathpath1.4determined automaticallyThe base path of the Java Development Kit (JDK). This is equivalent to the JAVA_HOME environment variable, and by default will be determined automatically from one of the following:
  • JAVA_HOME environment variable (all platforms)
  • Registry (Windows)
  • java_home tool (macOS)
  • Known JDK paths (other Unix platforms)
languageVersionstring1.4undefinedThe Java language version to interpret source code as. If undefined, the compiler will use its default.
runtimeVersionstring1.4undefinedThe version of the Java runtime to generate compatible bytecode for. If undefined, the compiler will use its default.
manifestobject1.4.2undefinedThe properties to add to the manifest file when building a JAR. The contents of this property will be aggregated with the values from manifestFile. If manifest and manifestFile contain the same key, the former will take precedence. If undefined, will not be taken into account.
manifestFilepath1.4.2undefinedThe manifest file to embed when building a JAR. The contents of this file will be aggregated with the values in manifest. If manifestFile and manifest contain the same key, the latter will take precedence. If undefined, will not be taken into account.
manifestClassPathstringList1.4.2undefinedThe entries to add to the manifest's Class-Path when building a JAR.
warningsAsErrorsbool1.4falseIf this property is enabled, the compiler will abort where it would normally emit a warning.

Relevant File Tags

TagAuto-tagged File NamesSinceDescription
"java.class"-1.4This tag is attached to the output artifacts of the rule that runs the javac tool.
"java.jar"-1.4This tag is attached to the output artifacts of the rule that runs the jar tool.
"java.java"*.java1.4Source files with this tag serve as inputs to the rule running the javac tool.