This name is derived from your filename with Kt appended. Then you can execute the program by running the com.my.stuff.AppKt class. To run a Kotlin class you are actually running a special class that is created at the file level that hold your main() and other functions that are top-level (outside of a class or interface). Which made me think that maybe I needed to add the class file to my declared classpath so: C:\Users\User\Desktop>java -cp kotlin-runtime.jar' _DefaultPackage.class _DefaultPackage So I tried the following: C:\Users\User\Desktop>java -cp kotlin-runtime.jar _DefaultPackageĮrror: Could not find or load main class _DefaultPackage This led me to believe that the Kotlin runtime was simply missing, given that output. When I try to run it like I would a normal java class I get the following: C:\Users\User\Desktop>java _DefaultPackageĮxception in thread "main" : jet/runtime/IntrinsicsĬaused by: : Īt $1.run(URLClassLoader.java:366)Īt $1.run(URLClassLoader.java:355)Īt (Native Method)Īt (URLClassLoader.java:354)Īt (ClassLoader.java:423)Īt $AppClassLoader.loadClass(Launcher.java:308)Īt (ClassLoader.java:356) Here is my situation: I can't run a compiled Kotlin class. I understand this question has been asked before, but none of the information there has helped me.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |