Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

javadoc command in batch file

Posted on 2011-09-09
23
Medium Priority
?
662 Views
Last Modified: 2012-05-12
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?
0
Comment
Question by:allelopath
  • 18
  • 5
23 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 36513083
You should take each of the parts in the double quotes
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36513089
And why fo you need start ?
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36513096
start "C:\Program Files\Java\jdk1.6.0_18\bin javadoc.exe" -d  "C:\Documents and Settings\jmyUsernmae -sourcepath C:\mySourceCode"
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 47

Expert Comment

by:for_yan
ID: 36513103
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
 
LVL 1

Author Comment

by:allelopath
ID: 36513105
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
 
LVL 47

Expert Comment

by:for_yan
ID: 36513107
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
 
LVL 1

Author Comment

by:allelopath
ID: 36513112
Same error with your suggestion
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36513115
you had also space beteween the folder and javadoc.exe

0
 
LVL 47

Expert Comment

by:for_yan
ID: 36513126
look below - that was still wrong variant
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36513133

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
 
LVL 47

Expert Comment

by:for_yan
ID: 36513135
only those pieces which have embedde spaces should be in quotes
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36513138
And if the last varian does not work - first try to run wiothout start in the beginning
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36513166


like in this example:

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

l
0
 
LVL 1

Author Comment

by:allelopath
ID: 36513185
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
 
LVL 47

Expert Comment

by:for_yan
ID: 36513195
sourcefilenames  - it says should be the last argument,

so I'd think "C:\my Source Code\*.java"
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36513199
It is not the folder with files but the actual files which should be argument
0
 
LVL 1

Author Comment

by:allelopath
ID: 36513210
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
 
LVL 47

Expert Comment

by:for_yan
ID: 36513216
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
 
LVL 47

Expert Comment

by:for_yan
ID: 36513231

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
 
LVL 47

Expert Comment

by:for_yan
ID: 36513235
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
 
LVL 47

Accepted Solution

by:
for_yan earned 2000 total points
ID: 36513243

Something like this (and of course mind the rule about spaces and quotes):
 C:> javadoc -classpath \user\lib -sourcepath \user\src com.mypackage
0
 
LVL 1

Author Comment

by:allelopath
ID: 36513258
Well, i just did it through eclipse, but thanks for your answers.
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36513267
Sure, with Eclipse it is even better
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This video teaches viewers about errors in exception handling.
Suggested Courses

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question