Results 1 to 2 of 2
  1. #1
    jon80's Avatar
    jon80 is offline Senior Member
    Join Date
    Feb 2008
    Location
    Malta (EU)
    Posts
    211
    Rep Power
    7

    Default [SOLVED] [newbie] javac

    How do I generate .class files within a pre-defined directory?
    E.g. I have c:<program name>\source for java files, and, c:<program name>\bin for generating .class files.

    :confused:


    C:\java\classes>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 u
    sed
    -classpath <path> Specify where to find user class files and annotati
    on processors
    -cp <path> Specify where to find user class files and annotati
    on processors
    -sourcepath <path> Specify where to find input source files
    -bootclasspath <path> Override location of bootstrap class files
    -extdirs <dirs> Override location of installed extensions
    -endorseddirs <dirs> Override location of endorsed standards path
    -proc:{none,only} Control whether annotation processing and/or compil
    ation is done.
    -processor <class1>[,<class2>,<class3>...]Names of the annotation processors t
    o run; bypasses default discovery process
    -processorpath <path> Specify where to find annotation processors
    -d <directory> Specify where to place generated class files
    -s <directory> Specify where to place generated source files
    -implicit:{none,class} Specify whether or not to generate class files for
    implicitly referenced 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
    -version Version information
    -help Print a synopsis of standard options
    -Akey[=value] Options to pass to annotation processors
    -X Print a synopsis of nonstandard options
    -J<flag> Pass <flag> directly to the runtime system


    C:\java\classes>java -version
    java version "1.6.0_14"
    Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
    Java HotSpot(TM) 64-Bit Server VM (build 14.0-b16, mixed mode)

  2. #2
    angryboy's Avatar
    angryboy is offline Senior Member
    Join Date
    Jan 2009
    Posts
    742
    Rep Power
    6

    Default

    c:\src\>javac -d c:\bin File.java

    type javac for more help.
    USE CODE TAGS--> [CODE]...[/CODE]
    Get NotePad++ (free)

Similar Threads

  1. excludes in javac target
    By ziggy in forum New To Java
    Replies: 2
    Last Post: 11-25-2008, 05:29 AM
  2. javac?
    By sardare in forum Eclipse
    Replies: 1
    Last Post: 06-14-2008, 03:06 AM
  3. cannot resolve symbol while using javac
    By andi9 in forum New To Java
    Replies: 5
    Last Post: 05-14-2008, 07:50 AM
  4. javac DOS
    By rdunne in forum New To Java
    Replies: 3
    Last Post: 01-01-2008, 12:49 PM
  5. Help with javaC
    By Daniel in forum New To Java
    Replies: 2
    Last Post: 07-04-2007, 03:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •