• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Problem of compile

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Today I write a target as follows:

<target name="compile" depends="prepare">
<javac srcdir="${src.dir}" destdir="${build.classes}" debug="true" debuglevel="lines,vars,source" >
<!-- No junit class-->
<exclude name="**/*Test.java" />
<!--the class needed for compile!!-->
<classpath>
<fileset dir="${oms.lib}">
<patternset refid="compile.used.libs" />
</fileset>
<fileset dir="./lib">
<patternset refid="compile.used.libs" />
</fileset>
</classpath>
</javac>
in my {src.dir} where has some files that not *.java file, after run ant, in the {build.classes} i only find the *.class files and the others are not there. Is any thing wrong? Thanks first!!
[ February 15, 2006: Message edited by: Bear Bibeault ]
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
javac compiles *.java files, and produces *.class files, which may optionally be in a different directory than the source files. It does not copy files. For that, you need to use Ants copy task.
 
Mark Wan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!!
Now I know a little more!

One more question:

at above code, if I defined:
<path id="build.path">
<pathelement path="${oms.lib}" />
<pathelement path="./lib" />
</path>

In target, I writed

<classpath>
<path refid="build.path" />
</classpath>
Now run ant ,compile will fail!!
The method I used is right?
[ February 15, 2006: Message edited by: Mark Wan ]
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't say how it's failing, but I think that this:

should more likely be this:

At least, that's how it works for me - I never tried it the way you have it.
 
Mark Wan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes,the way you used works well!
and it also can work as:

------------------------
over!!
[ February 16, 2006: Message edited by: Mark Wan ]
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic