Results 1 to 3 of 3
  1. #1
    dangr is offline Member
    Join Date
    Jan 2010
    Posts
    5
    Rep Power
    0

    Default problem with javac

    I download some source code from Internet for study input method.

    If I compile it as a project by jcreator no problem.

    If I try to compile these java sources by javac first source (Props.java) is compile.
    The second (ServiceManager.java)in not compile because and javac compiler prints the error: cannot find symbol Props.
    But this class is present in the same directory.
    Now if I compile them sources togher by the instruction javac Props.java ServiceManager.java there is no problem and the class
    files are products.
    The compiler write in the directory 3 files: Props.class, ServiceManager.class, ServiceManager$1.class
    Now what is the difference ?
    Why I cannot compile these source separately ?
    How can I compile them sepatately ?

    thanks in advance

    Dan

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,436
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by dangr View Post
    I download some source code from Internet for study input method.

    If I compile it as a project by jcreator no problem.

    If I try to compile these java sources by javac first source (Props.java) is compile.
    The second (ServiceManager.java)in not compile because and javac compiler prints the error: cannot find symbol Props.
    But this class is present in the same directory.
    Now if I compile them sources togher by the instruction javac Props.java ServiceManager.java there is no problem and the class
    files are products.
    The compiler write in the directory 3 files: Props.class, ServiceManager.class, ServiceManager$1.class
    Now what is the difference ?
    Why I cannot compile these source separately ?
    How can I compile them sepatately ?

    thanks in advance

    Dan
    You have to help javac (your compiler) a bit and tell it where it can find source files when it needs them: "javac -sourcepath <path where your sources are> SourceFile.java".

    kind regards,

    Jos

  3. #3
    bdtagar is offline Member
    Join Date
    Jun 2009
    Posts
    11
    Rep Power
    0

    Default

    Hi,
    Set Path variable on your OS, then issue this command at the command prompt:
    javac *.java

    Bye...

Similar Threads

  1. javac
    By PhilArmstrong in forum New To Java
    Replies: 31
    Last Post: 11-21-2009, 03:46 PM
  2. [SOLVED] javac problem
    By MithunDhar in forum New To Java
    Replies: 15
    Last Post: 04-06-2009, 04:19 AM
  3. javac?
    By sardare in forum Eclipse
    Replies: 1
    Last Post: 06-14-2008, 02:06 AM
  4. javac DOS
    By rdunne in forum New To Java
    Replies: 3
    Last Post: 01-01-2008, 11:49 AM
  5. Help with javaC
    By Daniel in forum New To Java
    Replies: 2
    Last Post: 07-04-2007, 02: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
  •