public final class JavacRunner extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
javac(File dir,
String source)
Runs javac.
|
static void |
javac(File dir,
String[] sources,
Object[] cp)
Runs javac.
|
static void |
javac(File dir,
String source,
Object[] cp)
Runs javac.
|
static File |
javacResource(File dir,
String resource,
String cls,
Object[] cp)
Compiles a file which exists as a resource.
|
static File |
javacResources(File dir,
String[] resources,
String[] cls,
Object[] cp)
Compiles files which exists as resources.
|
public static void javac(File dir, String source) throws Exception
dir - the directory where javac should runsource - file with source codeException - failed to compilepublic static void javac(File dir, String source, Object[] cp) throws Exception
dir - the directory where javac should runsource - file with source codecp - additional classpath (null not to add any
additional classpath). If this parameter is defined, any position in the
array which is null is replaced by the application's current
classpath. Inside this array both strings or files can be placed. Files
will be added to the classpath as absolute paths.Exception - compilation failedpublic static void javac(File dir, String[] sources, Object[] cp) throws Exception
dir - directory where javac should be runsources - files with source code. It can be null if
there are no files to compilecp - additional classpath (null not to add any
additional classpath). If this parameter is defined, any position in the
array which is null is replaced by the application's current
classpath. Inside this array both strings or files can be placed. Files
will be added to the classpath as absolute paths.Exception - failed to compilepublic static File javacResource(File dir, String resource, String cls, Object[] cp) throws Exception
dir - directory where javac should be runresource - the resource to compilecls - the name of the classcp - additional classpath (null not to add any
additional classpath). If this parameter is defined, any position in the
array which is null is replaced by the application's current
classpath. Inside this array both strings or files can be placed. Files
will be added to the classpath as absolute paths.Exception - failed to compilepublic static File javacResources(File dir, String[] resources, String[] cls, Object[] cp) throws Exception
dir - directory where javac should be runresources - the resources to compilecls - the name of the classescp - additional classpath (null not to add any
additional classpath). If this parameter is defined, any position in the
array which is null is replaced by the application's current
classpath. Inside this array both strings or files can be placed. Files
will be added to the classpath as absolute paths.Exception - failed to compileCopyright © 2015. All rights reserved.