javadoc command in batch file

I trying to write a batch file to run a javadoc command. The problem is the spaces in the path. I've got:

start "C:\Program Files\Java\jdk1.6.0_18\bin javadoc.exe -d  C:\Documents and Settings\jmyUsernmae -sourcepath C:\mySourceCode"

Nothing is produced by this. What am I doing wrong?
LVL 1
allelopathAsked:
Who is Participating?
 
for_yanConnect With a Mentor Commented:

Something like this (and of course mind the rule about spaces and quotes):
 C:> javadoc -classpath \user\lib -sourcepath \user\src com.mypackage
0
 
for_yanCommented:
You should take each of the parts in the double quotes
0
 
for_yanCommented:
And why fo you need start ?
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
for_yanCommented:
start "C:\Program Files\Java\jdk1.6.0_18\bin javadoc.exe" -d  "C:\Documents and Settings\jmyUsernmae -sourcepath C:\mySourceCode"
0
 
for_yanCommented:
actually this way:

start "C:\Program Files\Java\jdk1.6.0_18\bin javadoc.exe" -d  "C:\Documents and Settings\jmyUsernmae" -sourcepath C:\mySourceCode
0
 
allelopathAuthor Commented:
I had tried 3 parts:

start "C:\Program Files\Java\jdk1.6.0_18\bin javadoc.exe" "-d  C:\Documents and Settings\jmyUsername" "-sourcepath C:\mySourceCode"


but it gives an error saying it doesn't know what the -d part is then.
0
 
for_yanCommented:
actually this way

start "C:\Program Files\Java\jdk1.6.0_18\bin\javadoc.exe" -d  "C:\Documents and Settings\jmyUsernmae -sourcepath C:\mySourceCode"
0
 
allelopathAuthor Commented:
Same error with your suggestion
0
 
for_yanCommented:
you had also space beteween the folder and javadoc.exe

0
 
for_yanCommented:
look below - that was still wrong variant
0
 
for_yanCommented:

this should be correct:
start "C:\Program Files\Java\jdk1.6.0_18\bin\javadoc.exe" -d  "C:\Documents and Settings\jmyUsername" -sourcepath C:\mySourceCode
0
 
for_yanCommented:
only those pieces which have embedde spaces should be in quotes
0
 
for_yanCommented:
And if the last varian does not work - first try to run wiothout start in the beginning
0
 
for_yanCommented:


like in this example:

 C:> javadoc -windowtitle "Java 2 Platform" com.mypackage

l
0
 
allelopathAuthor Commented:
Got rid of Start, that's better. source path actually has spaces, too:
"C:\Program Files\Java\jdk1.6.0_18\bin\javadoc.exe" -d  "C:\Documents and Settings\jmyUsername" -sourcepath "C:\my Source Code\"

This gives:
javadoc: error -No packages or classes specified.
0
 
for_yanCommented:
sourcefilenames  - it says should be the last argument,

so I'd think "C:\my Source Code\*.java"
0
 
for_yanCommented:
It is not the folder with files but the actual files which should be argument
0
 
allelopathAuthor Commented:
I understand what are saying, but I need it to travel through that top folder recursively looking for java files. Is this not possible?
0
 
for_yanCommented:
A series of source file names, separated by spaces, each of which can begin with a path and contain a wildcard such as asterisk (*). The Javadoc tool will process every file whose name ends with ".java", and whose name, when stripped of that suffix, is actually a legal class name
0
 
for_yanCommented:

http://download.oracle.com/javase/1.4.2/docs/tooldocs/windows/javadoc.html#synopsis

javadoc [ options ] [ packagenames ] [ sourcefilenames ] [ -subpackages pkg1:pkg2:... ] [ @argfiles ]

-subpackages pkg1:pkg2:...
    Generates documentation from source files in the specified packages and recursively in their subpackages. An alternative to supplying packagenames or sourcefilenames.
0
 
for_yanCommented:
or maybe you need this part:

packagenames
    A series of names of packages, separated by spaces, such as java.lang java.lang.reflect java.awt. You must separately specify each package you want to document. Wildcards are not allowed; use -subpackages for recursion. The Javadoc tool uses -sourcepath to look for these package names. See Example - Documenting One or More Packages
0
 
allelopathAuthor Commented:
Well, i just did it through eclipse, but thanks for your answers.
0
 
for_yanCommented:
Sure, with Eclipse it is even better
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.