Java ANT Question:
Download Job Interview Questions and Answers PDF
Tell me how to set classpath in ant?
Answer:
PATH- and CLASSPATH-type references can be specified using both ":" and ";" as separator characters. Ant converts the separator to the correct character of the current operating system.
<classpath>
<pathelement path="${classpath}"/>
<pathelement location="lib/helper.jar"/>
</classpath>
The location attribute specifies a single file or directory relative to the project's base directory (or an absolute filename)
The path attribute accepts colon- or semicolon-separated lists of locations. The path attribute is intended to be used with predefined paths - in any other case; multiple elements with location attributes should be preferred.
The <classpath> tag supports path and location attributes of its own:
<classpath path="${classpath}"/>
<classpath>
<pathelement path="${classpath}"/>
<pathelement location="lib/helper.jar"/>
</classpath>
The location attribute specifies a single file or directory relative to the project's base directory (or an absolute filename)
The path attribute accepts colon- or semicolon-separated lists of locations. The path attribute is intended to be used with predefined paths - in any other case; multiple elements with location attributes should be preferred.
The <classpath> tag supports path and location attributes of its own:
<classpath path="${classpath}"/>
Download ANT Interview Questions And Answers
PDF
Previous Question | Next Question |
Tell me how to start to use Ant and provide a "Hello World" ant script? | Tell me how to use ant-contrib tasks? |