List of usage examples for javax.tools JavaCompiler isSupportedOption
int isSupportedOption(String option);
From source file:Main.java
public static void main(String[] args) { JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); Set<SourceVersion> srcVer = compiler.getSourceVersions(); for (SourceVersion sv : srcVer) System.out.println(" " + sv.name()); int nargs = compiler.isSupportedOption(args[0]); if (nargs == -1) System.out.println("Option " + args[0] + " is not supported"); else/* w ww. j a v a2s . c o m*/ System.out.println("Option " + args[0] + " takes " + nargs + " arguments"); }
From source file:CompilerInfo.java
public static void main(String[] args) { JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); System.out.println("Supported source versions:"); Set<SourceVersion> srcVer = compiler.getSourceVersions(); for (SourceVersion sv : srcVer) System.out.println(" " + sv.name()); int nargs = compiler.isSupportedOption(args[0]); if (nargs == -1) System.out.println("Option " + args[0] + " is not supported"); else/*w w w. j av a 2 s . c o m*/ System.out.println("Option " + args[0] + " takes " + nargs + " arguments"); }