1 / 22

Using Eclipse

Using Eclipse. Getting Started. There are three ways to create a Java project: 1:Select File > New > Project ,

annice
Download Presentation

Using Eclipse

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Using Eclipse

  2. Getting Started • There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper left of the toolbar. Select Project, or Right click on the Package Explorer view in the Java Perspective, and select Project. 3 Click on the icon on the toolbar. Select Java project and click Next.

  3. Next • Give the project a name. • If you would like to create src and bin folders for your java and class files respectively select the Create separate source and output folders radio button under the Project layout area of the New Java Project dialog. • The default source folder is src/ and the default output folder is bin/. You can change these defaults by clicking on the Configure default... link. Click the Next button.

  4. Next • The next screen has four tabs: Source, Projects, Libraries, Order and Export. • The source tab sets the source and output folders for Java files and class files. • The project tab allows you to connect your new Java project to any other Java projects that are needed on the new Java project's build path.

  5. Libraries TAB • The libraries tab allows you to attach jar files of and Java libraries that you may need. • The order and export tab determines the build order and how a project can be exported. • Make any changes needed here, and then click the Finish button.

  6. Java Perspective • If you are not in the Java perspective, Eclipse will ask if you would like to switch to the Java perspective. • The project will show up in the Package Explorer view.

  7. Creating a Java Package • There are four ways to create a Java Package. First, select the project you wish to create a package in. • Select File > New > Package, • Select the arrow of the button in the upper left of the toolbar. Select Package, • Right click on a project in the Package Explorer view in the Java Perspective, and select Package, or • Click on the icon in the toolbar.

  8. Check • Check to make sure that you are creating the package in the proper project and source folder. Give the package a name. Click Finish.

  9. Creating a Java Interface • There are four ways to create a Java Interface. • First, select the package you wish to create the interface in. 1:Select File > New > Interface 2: Select the arrow of the button in the upper left of the toolbar. Select Interface, 3:Right click on a package in the Package Explorer view in the Java Perspective, and select Interface, or 4: Click on the arrow of the icon in the toolbar. Select Interface.

  10. Check • Check to make sure that you are creating the interface in the proper package. • Give the interface a name. • Use the Add button to add interfaces that the new interface needs to extend. You may also select if you want generated comments added to the interface. • All generated comments are configurable under Window > Preferences > Java > Code Style > Code Templates. Click Finish. The new Interface will be open in the editor.

  11. Creating a Java Class There are four ways to create a Java Class. First, select the package you wish to create the class in. 1 Select File > New > Class 2 Select the arrow of the button in the upper left of the toolbar. Select Class, 3 Right click on a package in the Package Explorer view in the Java Perspective, and select Class, or 4 Click on the arrow of the icon in the toolbar. Select Class.

  12. Check • Check to make sure that you are creating the Class in the proper package. Give the class a name. • Use the Browse button to search for a super class if your new class should inherit from another class. • Use the Add button to add interfaces the new class should extend. • Check the public static void main(String [] args) checkbox if the class you are creating starts the application. • Check the Inherit abstract methods checkbox if you would like to inherit abstract methods from a super class or interface. • Click Finish. The new class will be open in the editor.

  13. Running the Program There are several ways to run a program. If the program has never been run before, you need to create run configuration for the program. 1: Select Run > Run.. 2: Click the arrow on the icon in the tool bar and select Run.. 3: Right click on the project you wish to run. Select Run > Java Application or Run > Run..1

  14. Creating a new run configuration Select Java Application, then click the New button at the bottom left of the screen. This creates a new run configuration. Give the setting a name. If the project is not specified, you can Browse for it. To find the main class in the project, select the Search button. If there are any command line arguments, enter them in the Program arguments text box under the Arguments tab. You can add jar files to the classpath under the Classpath tab. Click Run to run the program. If you have already created a run configuration, you can select the configuration by name by selecting the arrow on the icon in the tool bar. Just pressing the green button will run the last configuration launched by Eclipse.

  15. If • If you have already created a run configuration, you can select the configuration by name by selecting the arrow on the icon in the tool bar. • Just pressing the green button will run the last configuration launched by Eclipse.

More Related