0

I'm using IDEA to program java. And in my project src folder, I have two package "model" and "scene", and a Main.java to start my project. But now I find my classes in package cannot access to the Main, and I don't know why. My Main class is public I'm sure.

And now the only way I can find is create a new package "start" to store the Main.java, and import start package when I need Main.java. Well, I find this solution is really bad. Any advice? Thanks! :)

Eric Wang
  • 1
  • 2

2 Answers2

-2

I'm not sure about IntelliJ, but for Eclipse, I just put everything under a single default package. Create a package under src and put everything in there.

DucksEatTurtles
  • 194
  • 1
  • 2
  • 10
-2

You will need a package to find main from other classes, regardless of whether main is a public class or not.

HamishD
  • 349
  • 2
  • 15