Close

User Tag List

Results 1 to 5 of 5
  1. #1
    Earth's Protector
    Join Date
    Apr 2016
    Location
    World Martial Arts Championships
    Posts
    583
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    [Tutorial] Getting Started in Java (Eclipse)

    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.

    Step 1:
    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.


    Step 2:
    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.

    Step 3:
    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.


    Step 4:
    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.

    Step 5:
    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.

    Final:
    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:
    Code:
    /**
    * @author Iroflu
    *
    */
    The @author is the author of the code. It also helps to have '@version' under that, which for now, it's best to use the current date. So it would be: @version 6/29/2016


    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.
    Have a question? Look here! If it's not already there, feel free to ask!
    [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! ]

    Want to donate and get VIP Access?
    Click [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! ]!

    Want to help EmuCoach detect/fix bugs? Join our group, "Official Bug Testers"
    This group is for a more organized/official way of finding bugs in specific areas on the repack.
    Request to join if you're interested.
    (Note: this will not give you an official staff position)
    Click [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! ] to view our group page!


  2. #2

    Join Date
    Mar 2014
    Posts
    2,702
    Mentioned
    37 Post(s)
    Tagged
    1 Thread(s)
    Very nice! Thanks for the useful thread.
    Have a question? Look here! If it's not already there, feel free to ask!
    [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! ]

    Want to donate and get VIP Access?
    Click [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! ]!

  3. #3

    Join Date
    Feb 2016
    Location
    Cuba
    Posts
    65
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    jeje you forgot the Hello World.

  4. #4
    Earth's Protector
    Join Date
    Apr 2016
    Location
    World Martial Arts Championships
    Posts
    583
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ExO View Post
    Very nice! Thanks for the useful thread.
    Thanks, I plan on making a lot more, but I'm not sure when.
    I also have something in mind for a Java release, whenever I learn GUIs.
    Have a question? Look here! If it's not already there, feel free to ask!
    [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! ]

    Want to donate and get VIP Access?
    Click [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! ]!

    Want to help EmuCoach detect/fix bugs? Join our group, "Official Bug Testers"
    This group is for a more organized/official way of finding bugs in specific areas on the repack.
    Request to join if you're interested.
    (Note: this will not give you an official staff position)
    Click [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! ] to view our group page!


  5. #5

    Join Date
    Jun 2014
    Location
    Root
    Posts
    165
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Very nice as well! I look forward learning more

Visitors found this page by searching for:

Nobody landed on this page from a search engine, yet!
SEO Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •