%scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the &javac; compiler. JAVAC JAVACFLAGS JAVACCOM JAVACLASSSUFFIX JAVAINCLUDES JAVASUFFIX JAVABOOTCLASSPATH JAVACLASSPATH JAVASOURCEPATH JAVACCOMSTR Builds one or more Java class files. The sources may be any combination of explicit .java files, or directory trees which will be scanned for .java files. SCons will parse each source .java file to find the classes (including inner classes) defined within that file, and from that figure out the target .class files that will be created. The class files will be placed underneath the specified target directory. SCons will also search each Java file for the Java package name, which it assumes can be found on a line beginning with the string package in the first column; the resulting .class files will be placed in a directory reflecting the specified package name. For example, the file Foo.java defining a single public Foo class and containing a package name of sub.dir will generate a corresponding sub/dir/Foo.class class file. Examples: env.Java(target = 'classes', source = 'src') env.Java(target = 'classes', source = ['src1', 'src2']) env.Java(target = 'classes', source = ['File1.java', 'File2.java']) Java source files can use the native encoding for the underlying OS. Since SCons compiles in simple ASCII mode by default, the compiler will generate warnings about unmappable characters, which may lead to errors as the file is processed further. In this case, the user must specify the LANG environment variable to tell the compiler what encoding is used. For portibility, it's best if the encoding is hard-coded so that the compile will work if it is done on a system with a different encoding. env = Environment() env['ENV']['LANG'] = 'en_GB.UTF-8' Specifies the list of directories that will be added to the &javac; command line via the option. The individual directory names will be separated by the operating system's path separate character (: on UNIX/Linux/POSIX, ; on Windows). Include path for Java header files (such as jni.h) The Java compiler. The command line used to compile a directory tree containing Java source files to corresponding Java class files. Any options specified in the &cv-link-JAVACFLAGS; construction variable are included on this command line. The string displayed when compiling a directory tree of Java source files to corresponding Java class files. If this is not set, then &cv-link-JAVACCOM; (the command line) is displayed. env = Environment(JAVACCOMSTR="Compiling class files $TARGETS from $SOURCES") General options that are passed to the Java compiler. The directory in which Java class files may be found. This is stripped from the beginning of any Java .class file names supplied to the JavaH builder. Specifies the list of directories that will be searched for Java .class file. The directories in this list will be added to the &javac; and &javah; command lines via the option. The individual directory names will be separated by the operating system's path separate character (: on UNIX/Linux/POSIX, ; on Windows). The suffix for Java class files; .class by default. Specifies the list of directories that will be searched for input .java file. The directories in this list will be added to the &javac; command line via the option. The individual directory names will be separated by the operating system's path separate character (: on UNIX/Linux/POSIX, ; on Windows). Note that this currently just adds the specified directory via the option. &SCons; does not currently search the &cv-JAVASOURCEPATH; directories for dependency .java files. The suffix for Java files; .java by default. Specifies the Java version being used by the &b-link-Java; builder. Set this to specify the version of Java targeted by the &javac; compiler. This is sometimes necessary because Java 1.5 changed the file names that are created for nested anonymous inner classes, which can cause a mismatch with the files that &SCons; expects will be generated by the &javac; compiler. Setting &cv-JAVAVERSION; to a version greater than 1.4 makes &SCons; realize that a build with such a compiler is actually up to date. The default is 1.4. While this is not primarily intended for selecting one version of the Java compiler vs. another, it does have that effect on the Windows platform. A more precise approach is to set &cv-link-JAVAC; (and related &consvars; for related utilities) to the path to the specific Java compiler you want, if that is not the default compiler. On non-Windows platforms, the alternatives system may provide a way to adjust the default Java compiler without having to specify explicit paths.