![]() |
|
Tools Main |
Usage: javac [options] [javaSourceFiles] [@argfile]
- options - See below for details.
- javaSourceFiles - One or more source files to be compiled. Can also be directory.
- @argfile - One or more files containing options and Java source file names.
The javac compiler included in Ja.NET is based on a modified Eclipse JDT batch compiler. It has been enhanced to support code generation for both .NET and a standard Java platform. By default, the compiler will emit code for the .NET platform. The compiler options available to you are a superset of those available for the Eclipse batch compiler, and include both new and modified options specific for .NET. We have included the .NET specific options below for your reference. For a complete list of compiler options, you can reference the online Eclipse batch compiler documentation.
When javac is searching for types, it first looks for a source file. Then it looks for a class file by searching on the bootstrap, extensions, and user class path; in that order. You can specify .NET assemblies on the class path, as well as jar files and directories. Whenever the javac compiler needs to resolve or locate an assembly, it will search the bootstrap, extensions and user class path, in that order, searching for the assembly file. If it cannot be found, the compilation will terminate with error.
You can specify a list of directories, .jar files or .NET assemblies, to bootstrap the class files used by the compiler. By default the core libraries for .NET (i.e., mscorlib.dll and System.Core.dll) and Ja.NET (i.e., janet.luni.dll, janet.security.dll, etc.) are used. Entries are separated by the platform path separator. Each directory or file can specify access rules for types between '[' and ']'. If no bootclasspath is specified, the compiler will infer it using the following system properties in this order: sun.boot.class.path, vm.boot.class.path or org.apache.harmony.boot.class.path .
You can specify a list of directories, jar files, or .NET assemblies to be used when compiling the source files. The default value is the value of the property java.class.path. Entries are separated by the platform path separator. Each directory or file can specify access rules for types between '[' and ']' (e.g., [-X] to forbid access to type X, [~X] to discourage access to type X, [+p/X:-p/*] to forbid access to all types in package p but allow access to p/X)
For Java bytecode generation, this option specifies the debug attribute level generated in the class file. For .NET code generation, this option either enables or disables program database (PDB) file creation.
This option causes the compiler to emit Java byte code instead of MSIL. By default, the Ja.NET SE javac compiler will emit MSIL and produce .NET assemblies for each class compiled.
This option causes the compiler to scope Java package level items to a .NET assembly scope. By default, the compiler maps package scope to a public .NET scope.
This option will cause the compiler to invoke the Ja.NET SE bam utility to merge the .NET assemblies generated by the compiler into an assembly with the name assemblyFileName. The assemblyFileName can include an absolute path or can be relative. If a relative path is provided, then it will be treated relative to the -d directory, if specified, or to the current directory if not. If assemblyFileName does not exist, a new assembly with that name will be created. If an assemblyFileName is not specified, then a .dll assembly with the same name as the destination directory will be updated or created depending on whether it already exists. For more details, see the bam tool documentation.