I have a project with a mixture of Java and Kotlin files. Until recently I've been succesfully compiling it from the command line using a simple script like this:
export CLASSPATH=java/main
# compile Kotlin files
find java/main/ -type d \
| xargs kotlinc-jvm -cp java/lib/google-collections-0.9.jar -d java/main/
# compile Java files
find java/main/ -name '*.java' | xargs javac
Then I started using the JGraphT library, so that created a dependancy on the jgrapht jar. The library is referenced from the Kotlin files. I can still compile my project from IntelliJ, but can't get the command-line script working.
Here's what I have tried:
Add the jar to CLASSPATH. Doesn't work. Kotlin compiler doesn't see it. It probably ignores the CLASSPATH.
Add the jar as another
-cpparameter:find java/main/ -type d \ | xargs kotlinc-jvm \ -cp java/lib/google-collections-0.9.jar \ java/lib/jgrapht-core-0.9.1.jar \ -d java/main/
Then I get the following error:
error: source entry is not a Kotlin file: java/lib/jgrapht-core-0.9.1.jar
What am I doing wrong?
This is a small hobby project, mainly to play around with Kotlin. That's why I'm not using any build system, such as Ant or Gradle. (Another reason is I don't have any experience with these and they look scary. :))