java versus javac classpath
807597Jan 17 2005 — edited Jan 17 2005hi everyone:
this is a bit embarassing, as I have been using java for some time, but I recently came across a classpath conceptual difficulty.
My understanding was that 'javac' uses classpath to find the path to any classes referenced in a target for compilation. However, I couldn't come up with any concrete rationale for using an additional classpath for 'java', the JVM command, when developing your own applications (I can see its importance for third party classes).
Doesn't javac encode the classpath passed to it in the compiled class file itself? (I figured this because even if I do not specify a classpath to the 'java', the program still executes fine). If this is true, then the only way I see the 'java' classpath being useful is if you were to change around the location of the class files after compilation.
Any thoughts would be greatly appreciated.