title: Print the sourcecode of a whole java project
body: <p>I have to print the whole sourcecode of a java-project.
  The final version should look like: <strong>Eclipse: File -> Print</strong>.
  But with this function you can only print one file at once.</p>
  
  <p>Is there a way to print (or create a pdf/rtf of) the whole project (all *.java, *.xml, ... files) with one command?</p>
  
  <p>Im using eclipse galileo on windows xp sp3</p>
  
  <hr>
  
  <p><strong>EDIT:</strong> For each class/file the page should (more or less) look like this:    </p>
  
  <h2>C:\..\..\..\LibraryExtractor.java</h2>
  
  <pre><code>1 package utils.libraries;
  2
  3 import java.io.File;
  9
  10 /**
  11 * @
  12 * @
  13 * @
  14 */
  15 public class LibraryExtractor {
  16
  17 /**
  18 * 
  19 * 
  20 *
  21 * 
  22 * 
  23 *
  24 *
  25 */
  26 public static void extranctLibrary(String library, File targetFile) throws
  IOException, URISyntaxException {
  27 targetFile.getParentFile().mkdirs();
  28 if (!targetFile.exists())
  29 targetFile.createNewFile();
  30
  31 ClassLoader classLoader = LibraryExtractor.class.getClassLoader();
  32 InputStream in = classLoader.getResourceAsStream(library);
  33 OutputStream out = new FileOutputStream(targetFile);
  34
  35 byte[] buf = new byte[1024];
  36 int len;
  37
  38 while ((len = in.read(buf)) &gt; 0)
  39 out.write(buf, 0, len);
  40
  41 in.close();
  42 out.close();
  43 }
  44 }
  45
  </code></pre>
  
  <hr>
  
  <p><strong>SOLUTION:</strong></p>
  
  <ol>
  <li><p><a href="https://stackoverflow.com/questions/1921178/print-the-sourcecode-of-a-whole-java-project/2013631#2013631">enscript</a> (with Cygwin)</p></li>
  <li><p><a href="https://stackoverflow.com/questions/1921178/print-the-sourcecode-of-a-whole-java-project/2036974#2036974">Java2Html</a> Eclipse-Plugin (only
  works with Europa)</p></li>
  </ol>