On 6/8/06, Mikael Petterson (KI/EAB) <[EMAIL PROTECTED]> wrote:
How can I print what compiler is used ( exact version like 'java
-version') when compiling?
Probably the easiest way is creating a new task stuffed with all sorts
of information you want to log and calling it as a task:

The following compiles but I haven't tested it.


---8<----------------------------------------------
package org.isageek.m1fcj.dummy;

import org.apache.tools.ant.*;

public class SysInfo extends Task {

   public void execute() {
    // iterator over the conditions
           try
            {
              log("java class version: 
"+System.getProperty("java.class.version"));
              log("java vendor:        "+System.getProperty("java.vendor"));
              log("java vendor url:    "+System.getProperty("java.vendor.url"));
              log("java version:       "+System.getProperty("java.version"));
              log("OS architecture:    "+System.getProperty("os.arch"));
              log("OS name:            "+System.getProperty("os.name"));
            }
            catch (Throwable t)
            {
                log ("ooops...");
            }           
   }
}

---8<----------------------------------------------
--
Hakan (m1fcj)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to