Re: Help with multiple file projects

From: hiwa (HGA03630_at_nifty.ne.jp)
Date: 11/29/03


Date: 28 Nov 2003 21:40:04 -0800

herman404@hotmail.com (Herman) wrote in message news:<d647544a.0311281041.2eafb59d@posting.google.com>...
> "Dan Nuttle" <d_nuttle@hotmail.com> wrote in message news:<x39wb.16768$Rk5.2688@newsread1.news.atl.earthlink.net>...
> > I can't see any immediate cause for the compile error. Both classes are in
> > the same package, so you actually don't need to import Point in Polygon, but
> > doing so doesn't hurt anything. I pulled your code into Eclipse, using JDK
> > 1.3.1, commented out things like references to objects in your drawing
> > package, and the code compiled for me.
> >
> > So there's something else at work that you're not showing; unless there's
> > some big difference between 1.3.1 and 1.4.0 that I don't know about; I
> > don't think that's the case.
>
> I compiled it in the BlueJ IDE and it worked fine. Someone mentioned
> that in order to compile using packages with the Sun SDK, you needed a
> makefile or something like that. Anyone know how to compile multiple
> .java files into a package using the Sun SDK?

If your class A that belongs to package P does refer to class B that
also belongs to package P, then, when you compile A.java in the
current directory P,

javac -classpath .. A.java

If you compile A.java in the current directory ../P, which is the root
directory of package P,

javac -classpath . A.java

In order to learn classpath setting for Java package, read the J2SE
basic documents for javac compiler.



Relevant Pages

  • Re: Dealing with packages UNIX
    ... Everything has the same package name in teh same directory. ... ALso when my web app runs it is using an older version of the class file taht wont compile even afer I did a rm *.class and replaced them with the javac *.java. ... javac needs a defined sourcepath to work. ...
    (comp.lang.java.programmer)
  • Re: java packages
    ... Using the following to compile manually. ... javac -classpath %PROD_CLASSPATH% CSDSMsg.java javac -classpath %PROD_CLASSPATH% DBS.java javac -classpath %PROD_CLASSPATH% RunDBS.java javac -classpath %PROD_CLASSPATH% XSS.java ... Common Java package name nomenclature is to use all ... The source and class files are to all be in same directory DBS_Intercept ...
    (comp.lang.java.programmer)
  • Dealing with packages UNIX
    ... I have a problem i have all my .java files in a uploadEquity folder. ... When I compile a javac *.java Everything compiles. ... has the same package name in teh same directory. ...
    (comp.lang.java.programmer)
  • Re: Dynamic Plug-in Loading with Ada
    ... Ada under GNAT/Linux. ... The package implemented procedures to run statements, ... compile subprograms and to compile packages. ... unsuited to Live Coding, but it *can* be made to work. ...
    (comp.lang.ada)
  • Re: Modelsim : Problem with generics
    ... definition in that package. ... Entities in a file with there architecture, testbench in an other with ... tried a lot of things and the "compile all" was part of it. ... But what I saw is it seems that the testbench does not recompile ...
    (comp.lang.vhdl)