aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Having trouble with a really simple javadoc build Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Having trouble with a really simple javadoc build" Watch "Having trouble with a really simple javadoc build" New topic
Author

Having trouble with a really simple javadoc build

Bill Howanski
Greenhorn

Joined: Nov 24, 2012
Posts: 3
Hey guys, I'm having some trouble with a really simple build problem

So basically I have one class, let's call it test.java, and I want my build file to generate javadocs for it, so I did the following:

<target name="javadoc">
<javadoc sourcepath="./" destdir="./docs" />
</target>

the test.java is in the same directory as the build file

When I try to do this it tells me that "you must specify them as source files and not packages" and also "no source files and no packages have been specified."

Thanks in advance for all your help!
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

Tom, welcome to Java Ranch! Please see you private messages...

Could you post the full Ant output? I helps to see the full output and exact error message.

Generally, it is not a good idea to write packageless classes (several things don't work correctly with packageless classes). Also, it is generally not a good idea to place Java source files in the base directory. Usually you designate a directory such as src to contain Java sources. (I suspect that the javadocs task got confused because it will also look in the cods directory for things to process...)


JBoss In Action
Bill Howanski
Greenhorn

Joined: Nov 24, 2012
Posts: 3
Hey Peter thank you a lot for taking time to help me.

I think the problem is that I'm using a packageless class (so, my next question is, do I need to put my things in a jar file?)

[javadoc] /home/dc23/b2 contains source files in the default package, you must specify them as source files not packages.
[javadoc] Generating Javadoc
[javadoc] Javadoc execution
[javadoc] javadoc: error - Illegal package name: "/home/dc23/b2/test.*"
[javadoc] 1 error

BUILD SUCCESSFUL

Basically I have one java file (I compiled it so also the class) and I just want to use a build file to make a javadocs and store it in docs. Thanks a lot!
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30758
    
156

Bill,
Welcome to CodeRanch!

Putting the code in a jar doesn't put it in a package. You need to add "package bill" or the like to all your classes and put them in a folder called "bill".


[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
Bill Howanski
Greenhorn

Joined: Nov 24, 2012
Posts: 3
Got it to work, thank you very much!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Having trouble with a really simple javadoc build