This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
hi folks; i could not understand this. this is what i have:
C:\RnD javac java\ThisIsMyInterface.java compiles fine. C:\RnD javac java\TestIn.java gives me the following error:
but, i tried taking out package from both and compiled, it works just fine. i could not figure it out why? could please someone tell me what's going on here with package? thanks. [ November 12, 2002: Message edited by: Himal Chuli ]
Oops; not quite what I meant: you want to run the compiler and set the classpath so that "you" are not part of the classpath itself. If C:\RnD\java is the full path to your code, then do this:
That should do it.
Joined: Aug 06, 2002
hi Michael, i did as you told me to do, it seems like it's working but it did not generate any .class files at all. it didn't throw any error though. can you tell me why? also why the way i was doing is not working? thanks.
Hm. I'm not sure what to tell you. I recreated these files on my system, just to make sure I wasn't thinking wrongly. I put the two source files in /var/tmp/RnD/java on my system. Then I ran javac from the /var/tmp directory. No problems, and the class files ended up in /var/tmp/RnD/java as I expected. The reason for doing it this way: the compiler's working directory appears "above" where the code is in the file system, so it looks down from where it is to locate and store files. From this vantage point the package qualifier is unambiguous: "from here (/var/tmp), first find RnD/, then find java/ under that, and the files in question should be here." If the compiler works from somewhere inside the actual classpath (like in the RnD directory or folder), it looks down two levels from where it is and can't resolve location correctly. Search for the ThisIsMyInterface.class file -- it should be somewhere. Tell us where you found it too.