Running kotlinc -help
shows:
Usage: kotlinc-jvm <options> <source files>
That puts the options before the source files.? Which is pretty standard: most commands process their arguments in order, so I'd expect the command in the question to compile A.kt
before setting up the classpath to include B.jar
.
So you should try:
kotlinc -cp B.jar A.kt
Other potential causes include B.jar
not being present in the current directory (or not being given along with the necessary path info), and it not containing the relevant .class
files (in directories corresponding to their packages).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…