I use this to compile a class but why do I not see the .class version being set into the appropriate directory? When I do this, I get no .class file. If I compile without the -d, the .class version will end up in the same directory as the .java version.
Into which directory are you trying to put the class file when compiling?
Joined: Mar 15, 2000
It doesn't seem to make a difference. If I have a package com.test in the class and I try to compile with javac -d com\test cl.java it will say something like you can't compile into com\test\com\test. All I want to do is compile a class from the dos prompt and see it end up in the correct package/directory. Paul
-d is going to be the "base" directory. Like, the same thing that you'd use in CLASSPATH. So if you have a class called MyJunk in package "com.foo", and you want the thing to end up in /home/devel/classes/com/boo/MyJunk.class then you compile with javac -d /home/devel/classes MyJunk.java and you'd execute it with javac -classpath /home/devel/classes com.foo.MyJunk