Hi,
There's a difference in the JSR 199 area, for JDK 1.6 on Apple and Sun.. I can't get code like this...
javax.tools.Tool tool = javax.tools.ToolProvider.getSystemJavaCompilerTool();
To work on both Apple and Sun. :-(
The method is named getSystemJavaCompiler on Sun's JDK 1.6.
Apple
public class javax.tools.ToolProvider extends java.lang.Object{
public static javax.tools.JavaCompilerTool getSystemJavaCompilerTool();
public static java.lang.ClassLoader getSystemToolClassLoader();
static java.lang.String[] access$000();
static {};
}
Sun
public class javax.tools.ToolProvider extends java.lang.Object{
public static javax.tools.JavaCompiler getSystemJavaCompiler();
public static java.lang.ClassLoader getSystemToolClassLoader();
}
Both Apple and Sun return an instance of the same class name.
com.sun.tools.javac.api.JavacTool
so, maybe Apple can add the method
public javax.tools.JavaCompiler getSystemJavaCompiler()
and make everyone compatible.
(looks like everyone's got the same API but difference names)
Apple
public final class com.sun.tools.javac.api.JavacTool extends java.lang.Object implements javax.tools.JavaCompilerTool{
public com.sun.tools.javac.api.JavacTool();
public static com.sun.tools.javac.api.JavacTool create();
public void setOption(java.lang.String, java.lang.Object[]);
public void setExtendedOption(java.lang.String, java.lang.Object[]);
public com.sun.tools.javac.util.DefaultFileManager getStandardFileManager(javax.tools.DiagnosticListener);
void beginContext(com.sun.tools.javac.util.Context);
void endContext();
public com.sun.source.util.JavacTask getTask(java.io.Writer, javax.tools.JavaFileManager, javax.tools.DiagnosticListener, java.lang.Iterable, java.lang.Iterable, java.lang.Iterable);
public int run(java.io.InputStream, java.io.OutputStream, java.io.OutputStream, java.lang.String[]);
public java.util.Set getSourceVersions();
public int isSupportedOption(java.lang.String);
public javax.tools.StandardJavaFileManager getStandardFileManager(javax.tools.DiagnosticListener);
public javax.tools.JavaCompilerTool$CompilationTask getTask(java.io.Writer, javax.tools.JavaFileManager, javax.tools.DiagnosticListener, java.lang.Iterable, java.lang.Iterable, java.lang.Iterable);
}
Sun
public final class com.sun.tools.javac.api.JavacTool extends java.lang.Object implements javax.tools.JavaCompiler{
public com.sun.tools.javac.api.JavacTool();
public static com.sun.tools.javac.api.JavacTool create();
public void setOption(java.lang.String, java.lang.Object[]);
public void setExtendedOption(java.lang.String, java.lang.Object[]);
public com.sun.tools.javac.util.DefaultFileManager getStandardFileManager(javax.tools.DiagnosticListener, java.util.Locale, java.nio.charset.Charset);
void beginContext(com.sun.tools.javac.util.Context);
void endContext();
public com.sun.source.util.JavacTask getTask(java.io.Writer, javax.tools.JavaFileManager, javax.tools.DiagnosticListener, java.lang.Iterable, java.lang.Iterable, java.lang.Iterable);
public int run(java.io.InputStream, java.io.OutputStream, java.io.OutputStream, java.lang.String[]);
public java.util.Set getSourceVersions();
public int isSupportedOption(java.lang.String);
public javax.tools.StandardJavaFileManager getStandardFileManager(javax.tools.DiagnosticListener, java.util.Locale, java.nio.charset.Charset);
public javax.tools.JavaCompiler$CompilationTask getTask(java.io.Writer, javax.tools.JavaFileManager, javax.tools.DiagnosticListener, java.lang.Iterable, java.lang.Iterable, java.lang.Iterable);
}
Revealing the natural work around..
either
javax.tools.Tool javac = new com.sun.tools.javac.api.JavacTool();
or
javax.tools.Tool javac = com.sun.tools.javac.api.JavacTool.create();
Many thanks,
John
<test.zip> _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden