Hi Zvi, if you do <javac fork="true" executable="location of your javac 1.4exe"/> it should be fine ? if it is not working like that : - try running ant -verbose, you will get more information about what is happening, - send us the output of ant -verbose and an extract of your build file showing the javac task, Cheers Antoine ----- Original Message ----- From: "Rahamim, Zvi (Zvi) ** CTR **" <[EMAIL PROTECTED]> To: "Ant Users List" <[EMAIL PROTECTED]> Sent: Monday, June 02, 2003 6:51 AM Subject: RE: Specifying jdk compiler
Thank you Antoine Levy-Lambert your answer is exactly what I wanted. Regards to question 3: If I specify in the javac task that the compiler attribute is "modern" the jdk 1.3 will be used (and inside the code I can see that a Javac13 object will be created). I wnat to create a Javac14 that uses javac.exe in a specific location. I hope I explained better this time ;-) Thanks! Zvi -----Original Message----- From: Antoine Levy-Lambert [mailto:[EMAIL PROTECTED] Sent: Sunday, June 01, 2003 6:28 PM To: Ant Users List Subject: Re: Specifying jdk compiler Hi Rahamim, I do not understand your question number 3. For your question number 2 : If you want to find the java version installed under a specific path in your ant script, you can use the <exec/> task. It has an outputproperty attribute, with which you can capture in a property value the stdout produced by a program, so <exec executable="I:/Projects/JavaDevel/jdk1.4.1_02/java" outputproperty="javaversioninfo"> <arg value="-version"/> </exec> then you will have a property ${javaversioninfo} with version info. Or maybe you want to write something in your classes to say with which compiler you produced them ? Antoine ----- Original Message ----- From: "Rahamim, Zvi (Zvi) ** CTR **" <[EMAIL PROTECTED]> To: "Ant Users List" <[EMAIL PROTECTED]> Sent: Sunday, June 01, 2003 8:02 AM Subject: Specifying jdk compiler Hi! I have an ant script that use the javac and rmic tasks. They use the jdk that runs ant (I don't use fork in the javac task) Now I want to use another compiler and I used fork and executable attributes in the javac task but then the rmic task failed with the following error: Cannot use SUN rmic, as it is not available. A common solution is to set the environment variable JAVA_HOME or CLASSPATH. 1. Can you tell me why it happens and how to solve it ? I have jdk on my computer on a different pathes and with different versions (e.g: I:/Projects/JavaDevel/jdk1.3.1_02/ and I:/Projects/JavaDevel/jdk1.4.1_02/) 2. I know that I can use the javac executable attribute to compile with the above compilers, but how can I get from withing the script their versions (by now I've used the property value: "java.vm.version". 3. If I want to create a class for Javac_131_02 and Javac_141_02 that compiles using the above jdk, how can I do it (except for extends DefaultCompilerAdapter)? Thanks in advance!!! --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
