CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: compiling

  1. #1
    Join Date
    Aug 2000
    Posts
    25

    compiling

    Hi,
    If I've a lot of package like com.a.b.*; com.a.b.c*; com.a.d.*;........ and a lot of classes with imort packages like import com.a.b.*; import com.a.d.*;...please give me some ideas how to compile them. I try like:
    javac -classpath directory(which holds com.a......) *.java , but this seems not work. Thanks in advance.
    wang


  2. #2
    Join Date
    Jan 2000
    Location
    CA, USA
    Posts
    305

    Re: compiling

    Hi ,
    I think in such a case it will be better if you create a makefile, so
    that you need not follow all the steps of compiling again and again.

    Kannan



  3. #3
    Join Date
    Sep 2000
    Location
    Melbourne --> Australia
    Posts
    68

    Re: compiling

    Hi
    The easiest way i know how to do this is
    to make a .txt file with the names of the classes,
    The contents would be similar to this:

    YourFile.java
    AnotherFile.java
    AndYetAnother.java

    Save this file in the directory where
    all of your java files are, and then
    make your dos working directory in the same
    directory and then just type

    javac -d . @YourTxtFile.txt


    Dont forget the dot after -d
    This will compile and package all the
    files listed in your text file, unless
    they have errors.

    Good luck Phill.


  4. #4
    Join Date
    Aug 2000
    Posts
    25

    Re: compiling

    Hi,
    How can I make a jar file with only classes?
    When I try this like: jar myjar.jar *.class, it seems that my jar file contains
    all java source files, how can just jar class file? Thanks in advance.
    wang


  5. #5
    Join Date
    Sep 2000
    Location
    Melbourne --> Australia
    Posts
    68

    Re: compiling

    Hi
    You can do it by specifying which files
    you want in the jar file ie:

    jar cmf MANIFEST.MF YourJar.jar YourClass.class AnotherClass.class

    you can add a lot of classes this way or alternatively write all the names of the file
    in a text file and then go

    jar cmf MANIFEST.MF YourJar.jar @YourFileNames.txt

    good luck
    Phill.


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured