Class JDeps


  • public class JDeps
    extends Java
    A helper class for the jdeps utility.
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • JDeps

        public JDeps()
    • Method Detail

      • isAvailable

        public static boolean isAvailable()
        Checks whether jdeps is available at all.
        Returns:
        true if available
      • getExecutablePath

        public static String getExecutablePath()
        Returns the full path of the JMap executable, if possible.
        Returns:
        the full path of the executable if possible, otherwise just the executable
      • getDefaultOptions

        public static String getDefaultOptions()
        Returns the default options ("-histo:live") for jdeps.
        Returns:
        the default options
      • execute

        public static String execute​(String options)
        Executes jdeps and returns the output. Automatically adds classpath to commandline.
        Parameters:
        options - additional options for jdeps
        Returns:
        the output
      • execute

        public static String execute​(String executable,
                                     String options)
        Executes the executable and returns the output. Automatically adds classpath to commandline.
        Parameters:
        executable - the jdeps executable to use
        options - additional options for jdeps
        Returns:
        the output
      • execute

        public static String execute​(String executable,
                                     File[] classpath,
                                     String options)
        Executes the executable and returns the output. Automatically adds classpath to commandline.
        Parameters:
        executable - the jdeps executable to use
        classpath - the classpath parts (directories and jar files); uses application classpath if null or 0-length
        options - additional options for jdeps
        Returns:
        the output