Next: Runtime Options Up: XML Enhancements to Java™ Previous: XML Schema Built-in Types

Subsections


Compiler Options

The xjc compiler currently supports the following command-line options:

Classpath options

-cp or -classpath <directories and zip/jar files separated by ;>
-- specify location for application classes and sources
-bootclasspath <directories and zip/jar files separated by ;>
-- specify location for system classes
-d <dir>
-- destination directory (if omitted, no directory is created)
-d none
-- generate no .class files
-encoding <enc>
-- specify custom encoding for all sources. Each file/directory can override it when suffixed with "[<enc>]" (e.g. X.java[utf8])

Compliance options

-1.3
-- use 1.3 compliance level (implicit -source 1.3 -target 1.1)
-1.4
(default) -- use 1.4 compliance level (implicit -source 1.3 -target 1.2)
-source <version>
-- set source level (1.3 or 1.4)
-target <version>
-- set classfile target (1.1 to 1.4)

Warning options

-deprecation
(default) -- deprecation outside deprecated code
-nowarn
-- disable all warnings
-warn:none
-- disable all warnings
-warn:<warnings separated by ,>
-- enable exactly the listed warnings
-warn:+<warnings separated by ,>
-- enable additional warnings
-warn:-<warnings separated by ,>
-- disable specific warnings

allDeprecation -- deprecation including inside deprecated code
allJavadoc -- invalid or missing javadoc
assertIdentifier (default) -- "assert" used as identifier
charConcat (default) -- char[] in String concat
conditionAssign -- possible accidental boolean assignment
constructorName (default) -- method with constructor name
deprecation (default) -- deprecation outside deprecated code
emptyBlock -- undocumented empty block
fieldHiding -- field hiding another variable
finally (default) -- finally block not completing normally
indirectStatic -- indirect reference to static member
intfNonInherited (default) -- interface non-inherited method compatibility
javadoc -- invalid javadoc
localHiding -- local variable hiding another variable
maskedCatchBlock (default) -- hidden catch block
nls -- string literal lacking non-nls tag //$NON-NLS-<n>$
noEffectAssign (default) -- assignment without effect
pkgDefaultMethod (default) -- attempt to override package-default method
semicolon -- unnecessary semicolon, empty statement
unqualifiedField -- unqualified reference to field
unusedImport (default) -- unused import declaration
unusedLocal -- unread local variable
unusedPrivate -- unused private member declaration
unusedThrown -- unused declared thrown exception
unnecessaryElse -- unnecessary else clause
uselessTypeCheck -- unnecessary cast/instanceof operation
specialParamHiding -- constructor or setter parameter hiding another field
staticReceiver (default) -- non-static reference to static member
syntheticAccess -- synthetic access for innerclass
tasks(<tags separated by |>) -- tasks identified by tags inside comments

Debug options

-g[:lines,vars,source]
-- custom debug info
-g:lines,source
(default) -- both lines table and source debug info
-g
-- all debug info
-g:none
-- no debug info
-preserveAllLocals
-- preserve unused local vars for debug purpose

Advanced options

@<file>
-- read command line arguments from file
-maxProblems <n>
-- max number of problems per compilation unit (100 by default)
-log <file>
-- log to a file
-proceedOnError
-- do not stop at first error, dumping class files with problem methods
-verbose
-- enable verbose output
-referenceInfo
-- compute reference info
-progress
-- show progress (only in -log mode)
-time
-- display speed information
-noExit
-- do not call System.exit(n) at end of compilation (n==0 if no error)
-repeat <n>
-- repeat compilation process <n> times for perf analysis
-inlineJSR
-- inline JSR bytecode
-enableJavadoc
-- consider references in javadoc

XJ-specific options

-validate
(default) -- enable validation of inline XML construction
-novalidate
-- disable validation of inline XML construction
-nativeXPath
(default) -- compile XPath to direct accesses of XML for efficiency
-nonativeXPath
-- do not compile XPath to direct accesses of XML, use Xalan to evaluate XPath
-E or -shortErrors
-- enable one-line error messages

General options

-? or -help
-- print the help message
-version
-- print compiler version
-showversion
-- print compiler version and continue

Script options

-t or -trace
-- Print the command being executed
-cp or -classpath <PATH>
-- Append <PATH> to the java classpath
-P or -profile or -profile
-- Run with profiling
-J<arg>
-- Pass <arg> to java, e.g., use -J-verbose to make java execution verbose
-V or -version
-- Same as -version
-v or -verbose
-- Same as -verbose
-h or -help
-- Same as -help



Next: Runtime Options Up: XML Enhancements to Java™ Previous: XML Schema Built-in Types
XJ Group 2005-09-13