#Cant run anything with IntelliJ

1 messages · Page 1 of 1 (latest)

ionic ledge
#

Please help, I cant run anything it keeps telling me that the file in the editor is not runnable, ive been trying to fix it for a couple hours now, have tried everything, nothing will work

earnest craneBOT
#

<@&987246652869971988> please have a look, thanks.

turbid crag
#

full screenshot of the IDE please

ionic ledge
turbid crag
#

can u go to the project structure settings please

ionic ledge
#

rhought it might be because of the SDK?

#

im a beginner so im a little clueless

turbid crag
#

can u go to Modules

#

on the left

ionic ledge
turbid crag
#

ah okay, its a maven structure

#

looks okay so far

#

u can close that dialog

#

in ur file explorer on the very left, can u expand ur src folder please and show whats in there

#

down to ur files

#

so that i can see ur java files

ionic ledge
turbid crag
#

the java folder as well please

#

so that i can see all ur code files

ionic ledge
turbid crag
#

just that file?

ionic ledge
#

yep

turbid crag
#

okay. so u cant run it bc it has no main method

#

runnable files are files with a public static void main(String[] args) method

#

however, ur making a minecraft plugin

#

so this is likely not intended to be runnable from within the IDE

#

but instead it likely has to be "registered" towards ur minecraft and the game then understands the code and calls these callback methods u created

#

id suggest u follow a minecraft plugin tutorial or similar

#

and check how they teach their game to include that plugin

#

and possibly also how to attach a debugger, perhaps to the already running process

ionic ledge
#

Thats what i was doing, he didnt seem to have the same problem

turbid crag
#

he definitely wasnt able to run this from within intellij by clicking on the run button

#

it has no main method, it cant be executed like that

ionic ledge
#

The video is a little older so there might be things that have changed since

#

most likely a problem i made along the process

#

ill give the video a rewatch and let you know if Its still the same

#

could it be because of location> not sure but he has a seperate location designated to minecraft mine is still in the program files, which should be fine for java and stuff but i want to make sure for minecraft

turbid crag
#

if anything, it has to do with the run config

#

u can only click on the play button if the class has a main method (which this doesnt)
or if uve setup a manual run config

#

which u can do next to the play button

#

u could theoretically setup complex non-default actions there

#

such as "launch minecraft and do this and that"

#

but just clicking the run button without doing anything definitely wont work, as there is no main method here

#

think about it, how should java run this code. its a minecraft plugin, it cant work without minecraft

#

minecraft needs to run, know that plugin and call its callbacks

ionic ledge
#

right

#

is there something i could do about the main method?

turbid crag
#

adding a main method wont help u. i mean, intellij would then just run that main method, but that has nothing to do with ur plugin then

#

i never did any minecraft development, so no idea how ur supposed to do it

ionic ledge
#

got it