Class 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.String JAVA_HOME  
    • Constructor Summary

      Constructors 
      Constructor Description
      Javac()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static javax.tools.JavaCompiler getJavaCompiler()
      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 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Javac

        public Javac()
    • 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 path
        target - the target path
        other - 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 artifacts
        target - the target path
        other - 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.