For this tutorial, I'll be using Eclipse, as with any future tutorial I may make. I figure the first thing that you guys need to know, is how to start a Java project using Eclipse. Some may have already figured it out, and some may have already figured it out, or already know, in which case you can skip all of this.
This thread is only to show people how to start a Java project, including creating packages and classes.
First, open Eclipse.
It will ask you to set a Workspace, which is where all of your work will be located. As you can see in the picture, my Workspace is set to my School folder on my desktop, where it's easily accessible in case I ever need to access it. Wherever you decide to put it, it's up to you.
Also, if you want to, you can choose to set as default location and do not ask again. I did not choose this, just in case I ever need to change it without looking through the settings, but it's up to you.
Click 'Ok' once you've selected a Workspace.
After Eclipse is done loading, you might see a welcome page. You can close that out.
To start a new project, go to 'File', then 'New', then 'Java Project'.
Then, this box will pop up:
Type in whatever project name you want, then click Okay.
Now that your project is created, look in the far left panel of Eclipse, in the 'Package Explorer'. Find your newly created project, and click the down arrow next to it to expand it. You'll see two folders: 'src' and 'JRE System Library'. Ignore 'JRE System Library', what we want is the 'src' folder.
In order to actually code something, we need classes, but first, we need packages to store them. If you create a class without a package, it will go under a 'default package', but we don't want that if we're going to be professional, especially if we want proper organization. Right click the 'src' folder, go to 'New', then click 'Package'.
A box will pop up, and all you need to do is fill out the name of the package. There is a naming convention for packages, which can be found [Only registered users can see this link. Therefor you need to register first, and hopefully we see you wanting to join our friendly community we are trying to build up. Enjoy! ], and for this example, I will be naming it "com.emucoach.TestProject.model"
The 'com.emucoach." is based off of the site of the developer, or company, etc. The 'TestProject' is, of course, the name of the project. Then, after that, I have the ".model". The model package is where we put our main code, other than our controller class, which will be discussed in a future tutorial.
Now click Okay.
Now look back to the 'src' folder, and you'll notice the package we just created is there. The icon next to it is somewhat blank, meaning there's nothing inside it. So now that we have our package, we need a class. Right click the package, go to 'New', then click 'Class':
A box will pop up, where you can type the name of the class. All of the settings should be exactly where they need to be for now, except for 'Generate Comments'. You don't need to use this, however it really helps in explaining the code to you and future developers. It has other uses, but that's not important right now.
Now click Okay.
Now, in the center of Eclipse, you'll see some code. If you chose to 'Generate Comments', then you'll see something along the lines of:
The @author is the author of the code. It also helps to have [email protected]' under that, which for now, it's best to use the current date. So it would be: @version 6/29/2016Code:/** * @author Iroflu * */
As for the actual coding, I'll have to create another tutorial for that later.
I hoped this helped, and feel free to ask any questions.