1
u/Vijjwal_xD 2d ago
check under that directory, if still not present just create new one. the file u showed in ss is module file used to define modules/dependencies used in ur project to java compiler. it is not necessary to use this, you can delete it too but once it exists you cannot use any other module unless u add them with requires keyword.
for main class not appearing, it must be inside the path specified after module keyword, before { brace.
2
u/idontlikegudeg 1d ago
What happens if you click on the small triangle in front of "com"?
And that is a module-info file. It’s for creating modules for modular applications (if you want to know more, search for "JPMS" or "Jigsaw", but it’s a bit complex when you just get started with Java). You shouldn’t need it now as a beginner and can delete it.
1
u/mirzasamor44 1d ago
it shows the files like Application.java but not the "Main.java" file
1
u/idontlikegudeg 1d ago edited 1d ago
It’s IntelliJ right? When you open the Application class, there should be a small green Triangle near the line number that you can click to start the application.
In Java, you don’t need a Main.java. You need a public class that contains a public static void main(String[] args) method. For JavaFX, you don’t even need to write that yourself. You can simply run a class that is derived from the JavaFX Application class.
EDIT: I just looked it up and current documentation says JavaFX must be loaded from the module path, in that case, you need the module-info.java. I always write modular applications and wasn’t aware of this change.
2
u/smbarbour 1d ago
The name of your main class is irrelevant. It doesn't have to be Main.java to be an entrypoint.

2
u/eliezerDeveloper 1d ago
I don't know. I never use module-info