Tech Support Forum banner
Status
Not open for further replies.
1 - 4 of 4 Posts

·
Registered
Joined
·
170 Posts
Discussion Starter · #1 ·
I created this game from following a couple of different tutorials, and when i run it in Eclipse it runs fine, when i run it in NetBeans i get a no main class error. Do you have to make a main class for NetBeans and not eclipse? if so could someone help me with it because im more relevant towards eclipse...

P.S. I moved from Eclipse to NetBeans to see what the difference in programming was.
 

·
Emeritus
Joined
·
1,131 Posts
Re: Netbeans and eclipse difference?

Your main class is the one that has your main function. Say you're making an arcade game and you have a file called ArcadeGame.java that contains
Code:
public class ArcadeGame
{
  public static void main(String args[])
  {
    // Tons of cool stuff goes here.
  }
}
Your main class would be ArcadeGame. This is something you will have in all Java programs. NetBeans and Eclipse are just different IDE's, but are most likely using the same Java compiler (and other JDK components). They may require setting up projects differently, but the code will be the same.

The differences will be things like syntax highlighting, code autocompletion, debugging, refactoring features, search/replace, etc.

If you're using the same code in each IDE, then your issue is with how you set up your project in NetBeans. I primarily use vim for editing and build systems like Make, CMake, etc. so I can't think of exactly what to check in NetBeans off the top of my head. Look at the NetBeans documentation on setting up projects and make sure you added your files correctly.
 

·
Registered
Joined
·
170 Posts
Discussion Starter · #3 ·
Re: Netbeans and eclipse difference?

Thanks for the reply but i figured out what was wrong, since my game really has no main class, you have to set the thing up without the create main class checked.
 
1 - 4 of 4 Posts
Status
Not open for further replies.
Top