List of usage examples for javax.tools JavaCompiler getSourceVersions
Set<SourceVersion> getSourceVersions();
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 w w. ja va 2 s . c om 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//from ww w. java 2s.c o m System.out.println("Option " + args[0] + " takes " + nargs + " arguments"); }