|
To apply this technique to my example, put the source in directory mypackage and compile the way Paul outlined: "javac mypackage/Class1.java" "javac mypackage/Class2.java" This would have accomplished the same thing as what I did with the compile-and-move. I used to do it the way I outlined in my first message because I hated having source in a bunch of different little directories. Joe > -----Original Message----- > From: Clapham, Paul > > It worked just fine for me when I set up a test. This is what I did: I > created two classes, test1 and test2 and declared them to be in package T. > (First line of code is "package T;".) The class test1 does nothing except > print its name in its constructor, and test2 does nothing except > to create a > new test1 object in its main method. I put the source files, > test1.java and > test2.java, into directory /java/T on my V4R5 box. They have to be in a > directory whose path ends in "/T" because I declared them to be in package > T. > > Next, I started qsh and changed my current directory to be /java. Not > /java/T, but /java. Then I typed "javac T/test1.java" followed by "javac > T/test2.java". Both compiled correctly. And when I typed "java > T/test2", I > got the output from the constructor of test1. > > No PTFs, no workarounds. Works just the way it's supposed to.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.