Online compiler kotlin5/30/2023 Therefore your class name is the one you chose: // file App. You can change the name of this class within the file by adding this file-targeted annotation: can also put your main() into a class with a companion object and make it static using the JvmStatic annotation. This name is derived from your filename with Kt appended. Then you can execute the program by running the com.my.stuff.AppKt class. Select the version of the Kotlin compiler that is used to run both local and CI builds. 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 Try Kotlin and practice what youve learned so far. Getting started with the OneCompiler's Kotlin editor is easy and fast. It's one of the robust, feature-rich online compilers for Kotlin language. So I tried the following: C:\Users\User\Desktop>java -cp kotlin-runtime.jar _DefaultPackageĮrror: Could not find or load main class _DefaultPackage Click on RUN button to see the output Kotlin Online Compiler Write, Run
0 Comments
Leave a Reply. |