• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

how to compile all java source code in command line?

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've unzipped JDK source code src.zip to .\jdk\src\, but how to compile them in dos command and generate class files in a specified dir, say .\test\?
Thanks.
 
author and iconoclast
Posts: 24204
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, under plain old CMD.EXE it'd be hard, as there's no way that I know of to specify "all the *.java files" at the command line. If you've got Cygwin, or can do this on a UNIX system instead, then "find" is your friend:

% cd src
% javac -d ./test `find . -name '*.java'`

Now, I'm sure that won't complete without errors: there are likely dependencies on other code for which the source isn't provided. So you may need to use the -classpath switch to include one or more of the JAR files included in the JDK distribution.
[ February 21, 2005: Message edited by: Ernest Friedman-Hill ]
 
If you are using a wood chipper, you are doing it wrong. Even on this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic