file2: ```import com.file2 fun main() { file2.test...
# announcements
c
file2:
Copy code
import com.file2
fun main() { file2.test() }
n
compile them in order filrst,
com.file1
and then
come.file2
with the classpath set 🙂
c
ah. would you have an example how?
n
nope 🙂 i don’t use the command-line
c
ah, welp
I know how to compile them but I don't know what you mean by the classpath
also what about native and js?
n
https://kotlinlang.org/docs/tutorials/command-line.html i think
kotlinc --help
is your friend
c
Thanks
But that doesn't tell me how to compile with another file
n
there should be a
cp
or
classpath
option
👀 1
c
indeeed
but how would I use that for including another file?
Soo
I compiled it into jar
A jar
And added
Copy code
-cp file1.jar
To kotlinc's compile options.
Still errored out
(error: packages cannot be imported)
Compiling a class file created a directory com, trying to use that as the class path still says (error: unresolved reference: moduleTest)
But it's a different error at least..
n
there’s nothing kotlin specific here please check the java documentation relevant to classpath https://docs.oracle.com/javase/tutorial/essential/environment/paths.html
i
packages cannot be imported
Indeed, but you can import every declaration from a package:
import com.file1.*
c
Indeed, but you can import every declaration from a package: 
import com.file1.*
I am aware.
However that does not change anything 😛
there’s nothing kotlin specific here
please check the java documentation relevant to classpath
Nothing about including another file in your code there
turns out I just compile both the files lol
closed