javac Redirector README Copyright (C) 2007 JavaPLT Group at Rice University. All rights reserved. Please read the BSD license provided in license.txt. The javac Redirector is a small program, written in C++, that acts as a proxy for the javac executable. It can be configured to execute any other program and pass the arguments intended for javac along. This program became necessary during my experiments with modified versions of the Java compiler. I had created a jar (xajavac.jar) file that contained the modified compiler, and I could invoke it from the command line using "java -jar xajavac.jar ", but some IDEs use the javac.exe file directly and do not give me the choice to run a jar file. To remedy this, I created a copy of the JDK and replaced the original javac.exe executable with my javac Redirectory. I have also created a configuration file called javacredir.cfg in the same directory that contains the program to be executed instead of javac, plus any additional parameters. In my case, the copy of the JDK is installed in C:\jdk1.5.0_10_xajavac. Therefore, C:\jdk1.5.0_10_xajavac\bin\java.exe is the javac Redirector. I have also placed my modified compiler, contained in xajavac.jar, in the same directory. The C:\jdk1.5.0_10_xajavac\bin\javacredir.cfg file contains the following three lines: C:\jdk1.5.0_10_xajavac\bin\java.exe -jar C:\jdk1.5.0_10_xajavac\bin\xajavac.jar The first line tells the javac Redirector what program to execute. I want to execute the Java interpreter. The second and third lines contain arguments for the Java interpreter, telling it to execute the jar file with my modified compiler. When I now call javac.exe, instead of executing the original javac.exe, the compiler in my jar file is executed, and all the arguments I pass to javac.exe are passed to my compiler. The redirection is completely transparent. The configuration file has to be named javacredir.cfg and it has to be in the same directory as the executable file. The file to execute and all parameters are specified one per line. This program is open source as specified by the accompanying BSD license in license.txt. If you have any questions or comments, feel free to contact me. Please understand, though, that I may not have the time to provide support. Mathias Ricken