src/main/java/com/github/fracpete/deps4j/MinDeps.java
protected String determine() {
    String[] 			cmd;
    ProcessBuilder 		builder;
    CollectingProcessOutput 	output;
    List<String>		lines;
    int				i;
    String			line;

    for (String cls: m_Classes) {
      // progress
      System.err.println(cls);

      cmd = new String[]{
        m_Jdeps.getAbsolutePath(),
	"-cp",
	m_ClassPath,
	"-recursive",
	"-verbose:class",
	cls
      };
      builder = new ProcessBuilder();
      builder.command(cmd);
      output = new CollectingProcessOutput();
      try {
	output.monitor(builder);
      }
      catch (Exception e) {
        return "Failed to execute: " + builder.toString() + "\n" + e;
      }

      // filter output
      lines = new ArrayList<>(Arrays.asList(output.getStdOut().replace("\r", "").split("\n")));
      lines = filter(lines, packagesRegExp(), false);
      lines = filter(lines, ".*\\$.*", true);
      lines = filter(lines, ".*\\.jar\\)", true);

      // clean up
      for (i = 0; i < lines.size(); i++) {
        line = lines.get(i);
        line = line.replaceFirst(".* -> ", "");
        line = line.replaceFirst(" .*$", "");
        line = line.trim();
        lines.set(i, line);
      }

      // add to result
      m_DependentClasses.addAll(lines);
      System.err.println("--> " + m_DependentClasses.size());
    }

    return null;
  }
protected String determine() {
    String[] 			cmd;
    ProcessBuilder 		builder;
    CollectingProcessOutput 	output;
    List<String>		lines;
    int				i;
    String			line;

    for (String cls: m_Classes) {
      // progress
      System.err.println(cls);

      cmd = new String[]{
        m_Jdeps.getAbsolutePath(),
	"-cp",
	m_ClassPath,
	"-recursive",
	"-verbose:class",
	cls
      };
      builder = new ProcessBuilder();
      builder.command(cmd);
      output = new CollectingProcessOutput();
      try {
	output.monitor(builder);
      }
      catch (Exception e) {
        return "Failed to execute: " + builder.toString() + "\n" + e;
      }

      // filter output
      lines = new ArrayList<>(Arrays.asList(output.getStdOut().replace("\r", "").split("\n")));
      lines = filter(lines, packagesRegExp(), false);
      lines = filter(lines, ".*\\$.*", true);
      lines = filter(lines, ".*\\.jar\\)", true);

      // clean up
      for (i = 0; i < lines.size(); i++) {
        line = lines.get(i);
        line = line.replaceFirst(".* -> ", "");
        line = line.replaceFirst(" .*$", "");
        line = line.trim();
        lines.set(i, line);
      }

      // add to result
      m_DependentClasses.addAll(lines);
      System.err.println("--> " + m_DependentClasses.size());
    }

    return null;
  }
protected String determine ( ) { String [ ] cmd ; ProcessBuilder builder ; CollectingProcessOutput output ; List < String > lines ; int i ; String line ; for ( String cls : m_Classes ) { // progress System . err . println ( cls ) ; cmd = new String [ ] { m_Jdeps . getAbsolutePath ( ) , "-cp" , m_ClassPath , "-recursive" , "-verbose:class" , cls } ; builder = new ProcessBuilder ( ) ; builder . command ( cmd ) ; output = new CollectingProcessOutput ( ) ; try { output . monitor ( builder ) ; } catch ( Exception e ) { return "Failed to execute: " + builder . toString ( ) + "\n" + e ; } // filter output lines = new ArrayList <> ( Arrays . asList ( output . getStdOut ( ) . replace ( "\r" , "" ) . split ( "\n" ) ) ) ; lines = filter ( lines , packagesRegExp ( ) , false ) ; lines = filter ( lines , ".*\\$.*" , true ) ; lines = filter ( lines , ".*\\.jar\\)" , true ) ; // clean up for ( i = 0 ; i < lines . size ( ) ; i ++ ) { line = lines . get ( i ) ; line = line . replaceFirst ( ".* -> " , "" ) ; line = line . replaceFirst ( " .*$" , "" ) ; line = line . trim ( ) ; lines . set ( i , line ) ; } // add to result m_DependentClasses . addAll ( lines ) ; System . err . println ( "--> " + m_DependentClasses . size ( ) ) ; } return null ; }
Determines the dependencies.

@return		null if successful, otherwise error message
Determines the dependencies .