
-
Start JDeveloper by selecting Start > Programs > Oracle Fusion Middleware 11.1.2.0.0 > JDeveloper Studio 11.1.2.0.0
If a dialog box opens asking if you would like to import preferences from a previous JDeveloper installation, click NO.
-
In the Select Role dialog, choose Studio Developer and click OK.
Shaping, which is based on the role of the user, allows the JDeveloper environment to tailor itself. It does this by removing unneeded items from the menus, preferences, new gallery, and even individual fields on dialogs.Read more...
Close the Tip of the Day window.
-
Once loaded, the JDeveloper IDE appears. The very first time you open JDeveloper, the Start Page displays. You can re-invoke the Start Page later by choosingHelp > Start Page.
Notice the various options available to help you learn about JDeveloper. After exploring some of these options, close the Start Page by clicking the X on its tab (the X appears when you mouse over the tab).
-
Click the New Application link in the Application Navigator.
-
In the New Gallery, choose the Custom Application and click OK.
-
In the Name your application page of the Create Custom Application wizard, modify the default application name to MyFirstApplication, and make sure that the Application Package Prefix is empty. Note that the Directory Name changes accordingly. Click Next.
-
In the Name your project page of the wizard, change the default project name to MyProject, and in the list of available project features, select JavaServer Faces (JSF) and click the Add button to move it into the selected pane.
Notice that Java, JSP and Servlets, and XML are also moved into the Selected pane.
Click Next.
-
In the Configure Java settings page of the wizard, accept all defaults and click Finish.
The application is the highest level in the control structure. It is a view of all the objects you need while you are working. An application keeps track of all your projects while you are developing your Java programs.Read more...
-
In the Application Navigator, projects are displayed as the second level in the hierarchy under the application. The Application Navigator should look like this:
The Application Navigator is the main JDeveloper window from which you access the components of your application.Read more...
Notice that the project folder is a child of the application folder.
-
In the Application Navigator, notice the names of three accordion panes
-
Click an accordion name to expand it.
-
Click the name of an expanded accordion to collapse it.
-
Accordions are also available in other JDeveloper panes, such as the Structure window or Resource Palette.
-
Right-click the MyProject node in the Application Navigator and select New... from the context menu.
-
The New Gallery displays. By default, the first category, General, is highlighted in the Categories list. The other categories enable you to work with other JDeveloper technologies to build the various tiers of an application.
In the Items list in the right-hand pane select Java Class. Then click OK. -
In the Create Java Class dialog, change the default class name to Dog.
Accept all other defaults and click OK. -
The new class opens automatically in the source editor, displaying the skeleton class definition.
Add a method to the class. After the constructor, press [Enter] to create a new line, and type the following code:
Notice that the line that you just entered has a wavy red line under it, indicating a problem with the syntax. There are also red boxes in the right margin of the source editor. If you mouse over these boxes or over the wavy red line, a tooltip displays information about the error or errors. You see other examples like this in the Working with Code Assist topic later in this tutorial.
-
At the end of the line, press [Ctrl] + [Shift] + [Enter] and JDeveloper provides auto-completion of the method structure, and some of the error indicators disappear. However some indicators remain, showing that the syntax is still not complete.
Notice that auto-completion is also accessible from the Source > Complete Statement menu option.
-
Add code to provide the missing return statement.
In the blank line between the two curly braces that were added to the method, add the following code:
Notice that when you type the first double quote symbol ("), JDeveloper automatically provides you with the second double quote, enclosing the cursor between them, so that you can easily type the literal. Notice also that a green box has appeared in the upper right margin to indicate that there are now no syntax errors.
Code templates are a feature of the Java Source Editor. Code templates assist you in writing code more quickly and efficiently while you are in the source editor. You can edit existing templates or create your own. This step shows you how to use some of the existing code templates in the Dog class.
-
There is a code template for adding a main method to a Java class.
Press [Enter] to create a new line after the sayHi() method. Type the letter m, and press [Ctrl] + [Enter] to invoke code templates.The main method template is suggested.
-
Press [Enter] again to accept the suggestion and incorporate the template.
-
Create a Dog object in the main method by adding the following code:
Dog myDog = new Dog();
If you mouse over the