Class Javac
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.defaultInstantiators.AbstractFileInstantiator
-
- net.ssehub.easy.instantiation.java.instantiators.Javac
-
- All Implemented Interfaces:
IVilType
public class Javac extends AbstractFileInstantiator
Compiles java files using Javac.- Author:
- Holger Eichelberger, El-Sharkawy
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringJAVA_HOME
-
Constructor Summary
Constructors Constructor Description Javac()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static javax.tools.JavaCompilergetJavaCompiler()Gets the Java™ programming language compiler provided with this platform.static Set<FileArtifact>javac(Path source, Path target, java.util.Map<java.lang.String,java.lang.Object> other)Compiles a source path to a target path.static Set<FileArtifact>javac(Collection<FileArtifact> source, Path target, java.util.Map<java.lang.String,java.lang.Object> other)Compiles a source path to a target path.-
Methods inherited from class net.ssehub.easy.instantiation.core.model.defaultInstantiators.AbstractFileInstantiator
determineTargetPath, toString
-
-
-
-
Field Detail
-
JAVA_HOME
public static final java.lang.String JAVA_HOME
- See Also:
- Constant Field Values
-
-
Method Detail
-
javac
public static Set<FileArtifact> javac(Path source, Path target, java.util.Map<java.lang.String,java.lang.Object> other) throws VilException
Compiles a source path to a target path.- Parameters:
source- the source pathtarget- the target pathother- the other parameter for the Java compiler, without leading "-"- Returns:
- the created artifacts
- Throws:
VilException- in case that artifact creation fails
-
javac
public static Set<FileArtifact> javac(Collection<FileArtifact> source, Path target, java.util.Map<java.lang.String,java.lang.Object> other) throws VilException
Compiles a source path to a target path.- Parameters:
source- the source artifactstarget- the target pathother- the other parameter for the Java compiler, without leading "-"- Returns:
- the created artifacts
- Throws:
VilException- in case that artifact creation fails
-
getJavaCompiler
private static javax.tools.JavaCompiler getJavaCompiler()
Gets the Java™ programming language compiler provided with this platform.
If Java cannot find the compiler, this method will also try to use the JAVA_HOME variable to detect the compiler.- Returns:
- The Java™ programming language compiler or null if the compiler could not be found.
-
-