Java Error

JC0133

Senior member
Nov 2, 2010
201
1
76
So I am working on a group project to create a game for my Software engineering class. My group is using GIT and GITHUB to store/update the code.

So I created a clone from Git. I created a project in eclipse for the game. I deleted the src folder and I copied the .git folder, src folder, .gitignore text document,, nbactions.xml, nb-configuration.xml, pom.xml and README.md into the project folder from my GIT directory.

I don't think I needed all of these files but I don't think it will break the code either. I don't see any errors in the code or project.

Question, I am trying to run the game in Eclipse and I get the option to run it as Java Applet or Java Application. Either one I pick I get the error selection does not contain a main type or selection does not contain an applet.

Any ideas or help on how I fix this?
 

Cogman

Lifer
Sep 19, 2000
10,284
138
106
So here is how things generally work.

Instead of cloning out stuff and then copying the cloned files to the right destination, you should be working out of the directory where the clone dumps the files. The directory made by your version control stuff (git) is magic, trying to copy and paste things around from it is going to make you and your team members sad.

Next, the project was clearly created by netbeans and is clearly a maven project. Netbeans has much better maven support and is pretty decent in general, it might be worth it to switch and use netbeans instead of eclipse.

However, if you are bound and determined to use eclipse, I would suggest NOT creating a new project. Rather, eclipse has project import options that I would be leveraging. Since this is a maven project, you can instruct eclipse to import a maven project and it will do all of the setup needed to make things right.

Your project is likely erroring out because you set it up incorrectly. By not setting it up as a maven project in eclipse you are losing a lot. Maven is this magical thing that will go out and fetch every dependency you need to correctly compile a java project. On top of that it handles all the building and packaging of a java app. More than likely the reason your build is failing in eclipse is because you have none of the dependencies needed to correctly build.