Solved

javadoc command in batch file

Posted on 2011-09-09
23
614 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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 500 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sql import cannot be resolved jsp 3 117
junit example issue 2 56
Java array 21 150
Read CLOB data from Oracle using JAVA 3 40
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

739 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