#my code does not work in intelij but works in eclispse? why?

1 messages · Page 1 of 1 (latest)

velvet doveBOT
#

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

velvet doveBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

finite bobcat
#

Show the project structure

hallow timber
#

whats ur source file name?

#

Msg me again. Mistakenly i rejected it

coral karma
#

Go to File > Project Structure, and select at modules your source folder

#

File > Project Structure

#

Intellj

#

If that did not work send some screenshots of your project structure not only modules

finite bobcat
#

I mean the arrangement of folders and source files

#

as a screenshot

coral karma
#

Its a Java Server and not JavaScript, i only know JavaScript a bit like implementing it in a html file

#

u on school or what

#

I mean this:

#

at modules

#

modules is the important one rn

finite bobcat
#

iis your source code in src?

#

you could've just, you know, change the string

coral karma
#

Everything looks currently right for me at modules

finite bobcat
#

then show the file structure under src

coral karma
#

do a screenshot of what inside the src folder is

#

I see that Intellj not see them as Java classes

finite bobcat
#

your src is not a source directory

coral karma
finite bobcat
#

yes, but evidently it is not

coral karma
#

@empty laurel did you applyed the changes on project structure?

#

When intellj not see them as Java classes thats always a weird issue. Try this things: Check that project structure is applied, Not use the default SDK as language level

#

Go to Project Structure and select something else expect SDK default at language level

#

here in this window

#

you see under language level

silk abyss
#

You should be able to just right click src and make it the source directory

coral karma
#

its just a bad color pallet and hard to see

#

Here on the right side its selected

twilit portal
#

red marked settings----> project specific, blue marked---->for every project

#

you just have to select whatever version of jdk you want in SDK dropdown, if you don't have it then you can add it by option download jdk from dropdown

#

after that ---> apply--->ok

coral karma
#

Language Level or SDK: [DROPDOWN MENU ON CLICK]

#

are you on some 2012 old intellj?

twilit portal
#

looks something like this

twilit portal
coral karma
#

here @twilit portal he already did

#

click on reaction

twilit portal
#

are all your files inside src folder?

coral karma
#

.

twilit portal
#

select src folder--->select Sources from top to make it sources

coral karma
#

oh wait i see the problem

twilit portal
#

apart from that not sure how you don't have a jdk

coral karma
#

he selected the src folder from the other project he have inside and not the the src folder he is currently coding in

#

on the right side its a completly false directory

twilit portal
#

ye it's a diff one

coral karma
#

he is inside that command line folder with the src folder

#

wait no hes project name is the same as the folder inside

#

Why do you even have all ur old projects inside a new project?

#

Split them into different projects in different folders

#

not put all projects in one project

#

And go to configurations and select application and ur main class

#

I cant help you now anymore i go eat and then i need go to school, sry

#

yews

twilit portal
#

off-topic, prolly shouldnt have that folder names like that. Should be short.

young wyvern
#

What the hell is your project structure

#

Is this one project?

#

Or it is just a folder with all your projects

oak crown
#

He's doing it the eclipse way where you can have multiple projects showing in the same UI

#

Which is the problem

young wyvern
#

Ah I see

#

So ig the solution is to just not do that?

oak crown
#

Yeah can you explain that to him please

young wyvern
#

Explain what

oak crown
#

Jilko, you need to open each project individually in Intellij

young wyvern
#

Also I'm willing to bet your folder names will cause some kind of error

oak crown
#

What's the n word

young wyvern
#

Racial slur

#

Yeah and on that note that's just a block fronme

wispy jolt
#

i had a similar problem where if i clicked Create module-info.java file during the project creation my code wouldnt run but it would run on intellij

#

not sure if its the same problem tho

fathom crag
#

@empty laurel maven ? Gradle ? Something else?

#

Why do you have two src

#

Deleted which one ?

#

Why are you modifying the files anyway, the moment you create a project, everything should work properly
It seems you edited things that broke it

#

And also

#

What is this folder with the weird symbol

#

Which is ?

#

You should have a src folder directly under the project root

#

Please do that

#

Not in some weird folder

#

Doesn't mean it's correct

#

?

#

Please do what I said

#

Now delete the folder with the single letter

#

Delete it please

#

The folder with the single weird letter

#

Have you deleted it ?

#

Show a screenshot of your project

#

Now right click on src

#

Mark as

#

Source folder

#

Ah it's already a source root perfect

#

Now go in the main class

#

And click on the green arrow at the left of the class or main method

#

Calgu

#

So ?

#

Wdym

#

Ah

#

Use a double