Manuel Pérez Alcolea
02/19/2021, 5:16 AMjava
, how can I make it run? I've tried stuff like this:
$ java -cp "/usr/share/kotlin/lib/kotlin-stdlib.jar:." kott.AppKt
Error: Could not find or load main class kott.AppKt
Caused by: java.lang.ClassNotFoundException: kott.AppKt
$ java AppKt
Error: Could not find or load main class AppKt
Caused by: java.lang.NoClassDefFoundError: kott/AppKt (wrong name: AppKt)
ephemient
02/19/2021, 5:18 AM.
implies kott.AppKt
is can be found at ./kott/AppKt.class
. is it?Animesh Sahu
02/19/2021, 5:18 AMManuel Pérez Alcolea
02/19/2021, 5:19 AM/home/manuel/dev/kott/app/build/classes/kotlin/main/kott> ls
App.class AppKt.class
ephemient
02/19/2021, 5:19 AMephemient
02/19/2021, 5:19 AMAnimesh Sahu
02/19/2021, 5:19 AMManuel Pérez Alcolea
02/19/2021, 5:20 AMephemient
02/19/2021, 5:20 AMAnimesh Sahu
02/19/2021, 5:20 AM/home/manuel/dev/kott/app/build/classes/kotlin/main
hereephemient
02/19/2021, 5:20 AMkott.AppKt
from the file ./kott/AppKt.class
. if it is actually at ./AppKt.class
it will not be found.Manuel Pérez Alcolea
02/19/2021, 5:20 AM/home/manuel/dev/kott/app/build/classes/kotlin/main> java AppKt
Error: Could not find or load main class AppKt
Caused by: java.lang.ClassNotFoundException: AppKt
I dunno what I'm doing wrong yetephemient
02/19/2021, 5:21 AMjava kott.AppKt
ephemient
02/19/2021, 5:21 AMAnimesh Sahu
02/19/2021, 5:21 AMkott
Manuel Pérez Alcolea
02/19/2021, 5:21 AMManuel Pérez Alcolea
02/19/2021, 5:22 AM/home/manuel/dev/kott/app/build/classes/kotlin/main> java <http://kott.App|kott.App>
Error: Main method not found in class <http://kott.App|kott.App>, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application
okay it works now (except it doesn't, but I know why this doesn't work) thanks for the helpephemient
02/19/2021, 5:22 AMapplication
plugin, it can generate a startup script that encapsulates all the JAVA_HOME and classpath manipulationAnimesh Sahu
02/19/2021, 5:30 AM{FileName}Kt
file encapsulating the top-level main function.Animesh Sahu
02/19/2021, 5:31 AM@file:JvmName("...")
ephemient
02/19/2021, 5:31 AMephemient
02/19/2021, 5:33 AM@file:
annotations have to precede all other content in the file (except whitespace and comments, those are allowed)Manuel Pérez Alcolea
02/19/2021, 5:34 AMManuel Pérez Alcolea
02/19/2021, 5:35 AMManuel Pérez Alcolea
02/19/2021, 5:35 AMManuel Pérez Alcolea
02/19/2021, 5:35 AMAnimesh Sahu
02/19/2021, 5:36 AM