jQuery in Action, 2nd edition*
The moose likes Ant, Maven and Other Build Tools and the fly likes doing javadoc with ant in eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "doing javadoc with ant in eclipse" Watch "doing javadoc with ant in eclipse" New topic
Author

doing javadoc with ant in eclipse

Jason Hocker
Ranch Hand

Joined: Jul 23, 2003
Posts: 132
I have a build.xml that wants to do javadoc, but get the error...


Cannot run program "javadoc.exe": CreateProcess error=2, The system cannot find the file specified


How do I set the path?
Pavan Kumar
Ranch Hand

Joined: Jan 23, 2004
Posts: 78
Create Process Error=2 normally occurs when you don't have the specified process in path.

This is one way of doing it in ant (haven't tested this)
if you have a JAVA_HOME variable set, you could refer to the javadoc.exe as follows.

There may be other elegant ways. for instance the javadoc task in ant may be a better choice than exec. Or may be you could add JAVA_HOME/bin to your path.


formerly known as Cnu
Jason Hocker
Ranch Hand

Joined: Jul 23, 2003
Posts: 132
I planned to use the javadoc method. I am new to ant, so I appreciate any help.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Can you show us the relevant part(s) of your ant script, please?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Jason Hocker
Ranch Hand

Joined: Jul 23, 2003
Posts: 132


[edited to escape XML]
[ March 20, 2007: Message edited by: Jeanne Boyarsky ]
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30789
    
157

We have a separate forum for Ant, so I'm moving your post there since it has more to do with Ant than Eclipse.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Does the JAVA_HOME environment variable point to a correct JDK root folder?
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
If you run with -verbose argument you should see what path it is trying to use for javadoc.exe.

Here's mine:
Geoffrey Falk
Ranch Hand

Joined: Aug 17, 2001
Posts: 171
    
    1
I am having the same problem on my home PC. The strange thing is, it works fine on my computer at work, and they are similarly configured. My JAVA_HOME and ANT_HOME are set correctly.

Why can't Ant find the javadoc executable for the <javadoc> task, the same way it finds the javac executable for the <javac> task?

I just updated my Eclipse to the very latest updates (2009-03-26). I googled this today and found no help either.

Thanks
Geoffrey

Sun Certified Programmer for the Java 2 Platform
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi Geoffrey,

We try not to URL=http://faq.javaranch.com/java/DontWakeTheZombies]WakeTheZombies[/URL] around here . Can you post your specific problem in a separate thread? I'd post your full PATH and JAVA_HOME details in the new thread and we can get started!


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: doing javadoc with ant in eclipse