? Source.lookup(sourceString)
: Source.DEFAULT;
String targetString = options.get("-target");
//在这里lookup()一定不会返回null,因为在上面
//的option.process(options, flag, operand)时如果有错已经检测出来
Target target = (targetString != null)
? Target.lookup(targetString)
: Target.DEFAULT;
// We don't check source/target consistency for CLDC, as J2ME
// profiles are not aligned with J2SE targets; moreover, a
// single CLDC target may have many profiles. In addition,
// this is needed for the continued functioning of the JSR14
// prototype.
DEBUG.P("sourceString="+sourceString);
DEBUG.P("source="+source);
DEBUG.P("source.requiredTarget()="+source.requiredTarget());
DEBUG.P("targetString="+targetString);
DEBUG.P("target="+target);
//如果是"-target jsr14",则不用执行下面的代码
//target的版本号总是围绕source的版本号而变动的
if (Character.isDigit(target.name.charAt(0))) {
//当target的版本号<source的版本号
if (target.compareTo(source.requiredTarget()) < 0) {
if (targetString != null) {
if (sourceString == null) {//指定-target,没指定-source的情况
/*错误例子:
F:\Javac>javac -target 1.4
javac: 目标版本 1.4 与默认的源版本 1.5 冲突