Gradlew run for bot
[SOLVED]The bot works when i run it through Intelij but not when i try the terminal, is this familiar and anyone know how to help?
33 Replies
you need to set up the
application
gradle plugin
there's no run
taskdo i have to have a main class or can i just have a main function?
you have a main class, even if you haven't actually defined it yourself
what's the name of the file with your main function?
Main.kt
and i put this now in my build.gradle.kts
so then the class is called MainKt
the package is not
src.main.kotlin
are you new to kotlin?yesss haahaha
do you own a website?
or, well, a domain
no neither ; (
okay, do you have a github account?
YES!
that i do
so, kotlin was originally designed exclusively for the JVM
your code should be organised into packages to avoid conflicts with other classes
usually you'd use your site with the segments reversed, but since you don't have a site, you can use
io.github.yourusernamehere
right-click the kotlin folder and create a package with that name
then move your files into that package
IJ should update the package
declaration at the top of the file for you
alternatively, you don't have to create package folders, you can just add the line manually to the top of each file, package io.github.yourusernamehere
ahhh i see, ok ill try that!
ok so i assume you ment this setup?