Re: Compiling -- Can I Control Where .java and .class Files Are Kept?

From: Jonas Kongslund (dont_at_mail.me.at.all)
Date: 11/25/03


Date: Tue, 25 Nov 2003 08:15:50 +0100

Hal Vaughan wrote:

> Is there any way to tell javac that all .class files should be put in the
> bin dir?

Use the -d switch

$ javac -help
Usage: javac <options> <source files>
where possible options include:
  -g Generate all debugging info
  -g:none Generate no debugging info
  -g:{lines,vars,source} Generate only some debugging info
  -nowarn Generate no warnings
  -verbose Output messages about what the compiler is doing
  -deprecation Output source locations where deprecated APIs
are used
  -classpath <path> Specify where to find user class files
  -sourcepath <path> Specify where to find input source files
  -bootclasspath <path> Override location of bootstrap class files
  -extdirs <dirs> Override location of installed extensions
  -d <directory> Specify where to place generated class files
  -encoding <encoding> Specify character encoding used by source files
  -source <release> Provide source compatibility with specified
release
  -target <release> Generate class files for specific VM version
  -help Print a synopsis of standard options

-- 
Jonas Kongslund


Relevant Pages

  • Re: encrypted source file support in jdk?
    ... code is ecrypted at the file level. ... This requires javac to be able to ... en-/decrypt the source files. ...
    (comp.lang.java.help)
  • Re: Help with a basic example
    ... Actually javac doesn't care where you put your source files... ... But since most people organize their source files according to the ... This is obviously not a good thing, as you can't run the class files ...
    (comp.lang.java.help)
  • Re: can I import from foo.jar without unzipping?
    ... On Sun, 22 Aug 2004, jmm-list-gn wrote: ... I've searched Sun's website and haven't found anything ... Usage: javac <source files> ...
    (comp.lang.java.help)