Re: Confused about how packages work.
- From: Roedy Green <my_email_is_posted_on_my_website@xxxxxxxxxxxxxx>
- Date: Mon, 30 Jan 2006 06:06:46 GMT
On 29 Jan 2006 21:37:58 -0800, JoshRountree@xxxxxxxxx wrote, quoted or
indirectly quoted someone who said :
>
>When I compile MyTest.java with javac MyTest.java in the directory
>where both are located why does it say it cannot find MyOtherTest.java
The practical solution to your problem is to say:
javac *.java
and be done with it let Javac sort it out. This is what you have to do
to deal with circular references anyway.
It probably makes it worse that your classes are not public.
The solution you will eventually home in on is using ant scripts to do
your builds. Then you let ant worry about it.
It is tricky figuring out when Javac will compile or recompile classes
other than the ones you explicitly asked it to compile. I have found
that relying on Java to do that nearly always leads to trouble,
especially when you have mixed -target specifications.. I explicitly
compile the library packages first then client packages, always a
whole package at a pop, always using ANT, which does it every so much
more quickly than you can from the command line loading javac.exe over
and over.
See http://mindprod.com/jgloss/javacexe.html
http://mindprod.com/jgloss/ant.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
.
- References:
- Confused about how packages work.
- From: JoshRountree
- Confused about how packages work.
- Prev by Date: Confused about how packages work.
- Next by Date: Re: JAR file which needs to call another jar file....
- Previous by thread: Confused about how packages work.
- Next by thread: Re: Confused about how packages work.
- Index(es):
Relevant Pages
|