cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

compiling windchill .java files using ant

SimonLucas
1-Newbie

compiling windchill .java files using ant


Hi,


trying to compile a windchill .java file using ant and having no success. The command on its own in a windchill shell works fine ie "javac -d %WT_HOME%\codebase %WT_HOME%\codebase\com\ptc\windchill\uwgm\proesrv\c11n\DefaultModeledAttributesDelegate.java".


I have tried both :



srcdir="${wchome}/codebase/com/ptc/windchill/uwgm/proesrv/c11n"


destdir="${wchome}/codebase/com/ptc/windchill/uwgm/proesrv/c11n"


includes="DefaultModeledAttributesDelegate.java"


fork="true"


memoryMaximumSize="512M"


nowarn="true"


debug="true" >


<classpath>


<pathelement path="class.path"/>


</classpath>


</javac>



and


<exec executable="${wchome}/bin/windchill.exe">
<arg line="javac" -d=" %wt_home%=" codebase=" %wt_home%=" codebase=" com=" ptc=" windchill=" uwgm=" proesrv=" c11n=" defaultmodeledattributesdelegate.java&quot;="/>
</exec>



but neither seem to work. IN both cases I get java errors.



Any ideas?



Cheers
Simon Lucas


2 REPLIES 2

Hi Simon -


Try declaring the properties you are using in the ANT file, and explicity add the PTC resources needed for compilation to the classpath:


<property name="windchill.home" location="C:/ptc/Windchill_9.1/Windchill"/>

<javac<br/>srcdir="${windchill.home}/codebase/com/ptc/windchill/uwgm/proesrv/c11n"
destdir="${windchill.home}/codebase/com/ptc/windchill/uwgm/proesrv/c11n"
includes="DefaultModeledAttributesDelegate.java" fork="true"
memoryMaximumSize="512M"
nowarn="true"
debug="true" >
<classpath id="classpath">
<pathelement location="${windchill.home}/codebase"/>
<pathelement location="${windchill.home}/codebase/WEB-INF/lib/ie.jar"/>
<pathelement location="${windchill.home}/lib/wnc.jar"/>
<pathelement location="${windchill.home}/codebase/WEB-INF/lib/wncWeb.jar"/>
<pathelement location="${windchill.home}/codebase/lib/log4j.jar"/>
<pathelement location="${windchill.home}/lib/servlet.jar"/>
</classpath>
</javac>



Let me know if you are still having problems.


Thanks -


Todd

Todd,



many thanks -including the individual pathssolved the issue. Obvious thing to do really I guess - when your brain is swithed on 🙂


Simon Lucas


Top Tags