Should the project name of my Java application ?

  • Java
  • Thread starter Math10
  • Start date
  • #1
301
0

Main Question or Discussion Point

Should the project name of my Java application must be the same as the name when I save my Java application? Because I'm using Netbeans IDE 8.0.2 and in the project name field, I put First Java Program and after I wrote the Java application, when I save it, I put GetStarted.java in the save as field. Is this okay? And how do I compile my Java application from here?
 

Answers and Replies

  • #2
259
786
No, not necessarily.

You have a class named GetStarted in the file GetStarted.java, right? If it is your only class and there is a main method within that class you can compile it by just pressing the green button that has the shape of a triangle. In your case Netbeans will configure the compiler to compile said file (GetStarted.java). If you have more than one class with a main method, Netbeans will ask you which one you want to compile.
 
  • #3
301
0
Thank you for the help. I did as you said and got
run:
BUILD SUCCESSFUL (total time: 0 seconds)
in the output window in my IDE. So did I did this right?
 
  • #4
259
786
Yes, you did it right. ;)

However, if there was some code that printed text on the screen on the main method within GetStarted.java you should have seen that too.
 
  • #5
301
0
So in order to run (execute) a Java application, just press the green button that looks like a triangle and you're done, right?
 

Related Threads on Should the project name of my Java application ?

Replies
3
Views
607
Replies
3
Views
11K
  • Last Post
Replies
1
Views
827
Replies
2
Views
2K
Replies
2
Views
1K
Replies
18
Views
9K
Replies
1
Views
6K
Replies
6
Views
12K
Top