cannot run a new java file in a newly created project in intellij IDEA 2018.1 Ultimate

Answered

Hi, i am totally new to java. I was able to successfully create my first project "MyPrograms". Then i created another new java file "first_program.java" under the "MyPrograms" directory. When i run it the previous file created automatically while creating the project  the "Hello world " application is being executed. Please suggest how to run the new created java file"first_program.java".



0
3 comments
Avatar
Yaroslav Bedrov

Hello,

Your "first_program.java" isn't located under sources root. Please move it under "src" directory.

 

0

@Yaroslav Bedrov thanks man it worked

 

0
Avatar
Yaroslav Bedrov

You are welcome!

0

Please sign in to leave a comment.