javac - differences between classpath and sourcepath options
- by Alex
Hi,
I read the Sun documentation and a lot of Q/A on SO but I'm still a little bit confuse regarding the differences between the javac options -cp and -sourcepath.
Let say I have this directory structure:
c:\Java\project1\src (where the .java source files are)
c:\Java\project1\bin (where the .class will be or are already)
The class source MainClass.java is in a package "com.mypackage" and the directory structure is ok in src.
I'm in the project1 directory. I run
c:\Java\Project1\javac -d bin -sourcepath src src/com/mypackage/MainClass.java
or
c:\Java\Project1\javac -d bin -classpath src src/com/mypackage/MainClass.java
and I obtain the same result. In verbose mode, the search path for source files is src in both cases.
If anybody could help me figure out the specifics of these options, it would be great.
Thank you.