K
Kord3mo ago
Canute

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?
No description
33 Replies
gdude
gdude3mo ago
you need to set up the application gradle plugin there's no run task
Canute
Canute3mo ago
do i have to have a main class or can i just have a main function?
gdude
gdude3mo ago
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?
Canute
Canute3mo ago
Main.kt
Canute
Canute3mo ago
No description
Canute
Canute3mo ago
and i put this now in my build.gradle.kts
No description
gdude
gdude3mo ago
so then the class is called MainKt the package is not src.main.kotlin are you new to kotlin?
Canute
Canute3mo ago
yesss haahaha
gdude
gdude3mo ago
do you own a website? or, well, a domain
Canute
Canute3mo ago
no neither ; (
gdude
gdude3mo ago
okay, do you have a github account?
Canute
Canute3mo ago
YES! that i do
gdude
gdude3mo ago
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
Canute
Canute3mo ago
ahhh i see, ok ill try that!
Canute
Canute3mo ago
ok so i assume you ment this setup?
No description
Want results from more Discord servers?
Add your server