Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

javadoc command in batch file

Posted on 2011-09-09
23
Medium Priority
?
647 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
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.
Suggested Courses

715 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