BreadcrumbsHome / Java Eclipse Tutorial – Part 12: Setting Preferences
Java Eclipse Tutorial – Part 12: Setting Preferences
Last Updated on Thursday, 14 May 2015 Written by Chad Darby Saturday, 30 August 2014
In this video you will learn how to set some of the most common Eclipse preferences.
Please subscribe to this channel 🙂
|1||Installing the Eclipse IDE||03:18|
|2||Create a Java Application with Eclipse||03:44|
|3||Exploring the Eclipse User Interface||04:50|
|4.1||Searching and Navigating Source Code (part 1)||04:18|
|4.2||Searching and Navigating Source Code (part 2)||06:06|
|5||Generating Java Source Code||05:12|
|6.1||Refactoring Code - Extract Constants and Variables||04:13|
|6.2||Refactoring Code - Extract Methods, Rename Methods and Variables||04:19|
|7||Debugging Java Source Code||04:34|
|8||Adding JAR Files||05:17|
|9||Running JUnit Tests||05:08|
|12||Setting Eclipse Preferences||04:09|
Time – 00:00
Hi, this is Chad (shod) with luv2code.com. Welcome back to another tutorial on Eclipse. In this video, you’ll learn how to set some of the most common Eclipse preferences.
Time – 00:10
Preferences allow you to customize your Eclipse environment. I’ll show you, how to set the following preferences. We’ll look at setting the Java version, font sizes, line numbers and the default username. Okay, so let’s get started.
Time – 00:28
You can access the preferences window by selecting window preferences. You can configure Eclipse to use certain version of Java. For example, if you have multiple versions of Java installed, you can configure Eclipse to use a desired version.
Time – 00:43
To set the current version of Java that Eclipse will use, in the preferences window, you’ll select Java, installed JREs. This will show which JREs are installed and you can choose a different version, if desired. You can also set the compliance level by choosing Java compiler. This will tell Eclipse to make sure the code is compliant with the selected version of Java.
Time – 01:09
Another preference that I always set is display line numbers. By default Eclipse will not show you the line numbers. Take a look at the current screenshot. However, I find it very useful for the editor to display the line numbers for the source code.
Time – 01:24
You can set this in the preferences, it’s under general, editors, text editors and has a checkbox here for line numbers. You toggle that it will display the line numbers in the user interface. I also like to increase the font size. Sometimes I find it hard to view the small font, of course this is the personal preference, you may prefer small fonts.
Time – 01:58
You can set the font size by going to general, appearances, colors and fonts. Expand the section for Java, move down to the Java editor font, click the edit button, choose your desired font.
Here I’ll just increase the size to 24, close that click okay and note we have a much larger font in the editor.
Time – 02:26
I also like to change the default username for code templates. This is the username that Eclipse uses, when it inserts Java documentation. You can edit this preference by selecting Java, code style, code templates and then you select comments and expand the types, click edit. Here, what I’ll do is, I will append the website to the dollar sign user. This will show up in the actual Java documentation for new classes. luv2code.com, click okay and then click okay.
Time – 03:10
Now, when we add a new Java class, we will see this new information. New class, I’ll just enter a simple name of foobar, hit finish. Now, what I’ll do is, I will go through and add a comment at the beginning of this file. Here we go, we see this luv2code and our website luv2code.com.
Time – 03:38
If you can’t figure out how to set up preference, Eclipse has nice search feature. In the preferences window, you can enter a search string in the box. For example, if I want to find out, how to show the line numbers in the search box, I’ll type “line numbers” and it will take me directly to the location where I can set this option. This is very useful for finding a given preference to set.
Time – 04:02
Okay, so this wraps up our video on setting preferences in Eclipse. Please subscribe to our channel to view more videos on Eclipse and Java. Click the thumbs up to like our video. Also visit our website luv2code.com to download Java source code.