Cannot create artifacts

Answered

Hello, I'm trying to export my Java project as JAR file.
However, going to create the artifats, from the menu I cannot select the main of my project (I can't select anything)
How can I do?

Artifacts creation:

My file:

the main is main_db.java

Thank you

1
4 comments
Could you share a small screen recording of the process so we could confirm what you see? You can upload it safely at https://uploads.jetbrains.com/. 

Are you able to manually type your main class name similar to the video here: https://www.jetbrains.com/help/idea/working-with-artifacts.html#configure_artifact 
0

Upload id: 2025_10_01_DfzfYcV38iUEswMUqfeKFP (file: recording.mp4)

If I try to write manually, the Manifest file is not valid(I also did this test in the video)

0

Could you wrap the main method to with the class name(main_db) like below and try? Using functions without an explicitly defined class is apt for a single file application, but for the JAR entry point the class name should be defined. 

class main_db{
void main(){
System.out.println("Hello World"); System.out.println(this.getClass().getName()); }
}

1

Thank you, i solved the problem

0

Please sign in to leave a comment.