Oracle ADF Faces Cookbook
上QQ阅读APP看书,第一时间看更新

Preparing and structuring the OS for JDeveloper and ADF

It's important to understand the memory consumption of your software in order to work effectively without any trouble. If you would like to have a complete environment to work with ADF effectively, with your local machine, you might need to install JDeveloper and Oracle Database locally—if you like to work offline—which is a lot of memory consumption, not to mention when you debug and run your application against the application server, which would also have a medium to large memory footprint. So, make sure you have enough memory and processing power to start working with ADF effectively.

Getting ready

The following are considered minimum hardware requirements for your development machine:

  • Minimum 4 GB Memory (RAM)
  • Fast CPUs (for example, Intel Core i5)
  • SSD Hard drive, HDD with minimum 7200 RPM, or Hybrid HDD

    Tip

    For more information and guidance about performance and memory, check this great video by Chris Muir at http://www.youtube.com/watch?v=GXABzw7qU9g.

After making sure you have enough processing and memory power, you will still need to prepare your environment. You should always start by creating the directory structure to make sure everything goes into the right place, and to be in control especially after your project expands. It's always a good practice to organize how to reach your information effectively, after which you should start the installation process of your software.

How to do it…

In order to prepare and structure your operating system ADF, perform the following steps:

  1. Create your directory structure properly. What I usually do is start from the root directory of my user, for example, C:\Users\Amr in Windows or /Users/amr in a Nix-based OS, and start adding the structure of my development environment. So, in Windows, for instance, my workspace under the user directory looks like the following screenshot:
    How to do it…
  2. Create a dev directory where all the development will reside.
  3. Create an apps directory, which will contain all the software starting from JDK to the middleware inside the Oracle directory.
  4. Create a myworkspaces directory inside the dev directory, which will include different workspaces for each technology—you are free here to make it as per technology or per actual project—and then in each technology you have your different applications.

    Tip

    I didn't introduce any whitespaces; this is important as whitespaces can cause too many troubles when dealing with JDeveloper and Java in general.

  5. Create different environment variables for your development environment's dev directory, apps directory, and myworkspaces directory. This extra step will make it easy when you are installing different software to reach these directories easily using the command line. You should end up with the following environment variables:
    $DEV_HOME=/Users/amr/dev
    $APPS_HOME=$DEV_HOME/apps
    $WORK_HOME=$DEV_HOME/myworkspaces
    
  6. You can do the same in Windows by simply navigating to System Properties | Advanced | Environment variables and create three variables with these names:
    DEV_HOME=C:\Users\Amr\dev
    APPS_HOME=%DEV_HOME%\apps
    WORK_HOME=%DEV_HOME%\myworkspaces
    

    Tip

    Sometimes you might not have enough security privileges to access System Environment Variables. However, you can achieve the same results by opening the command prompt and using the set command as follows:

    set DEV_HOME=C:\Users\Amr\dev
    set APPS_HOME=%DEV_HOME%\apps
    set WORK_HOME=%DEV_HOME%\myworkspaces
  7. If you have Mac or other Nix-based systems, you can achieve the previous result by changing the .bash_profile file using a text editor or any text editing tools.

    Tip

    I always prefer to use vi or vim when it comes to Nix-based systems, but you can use any text editing tool of your choice. To know more about vi or vim, check these resources at http://www.unix-manuals.com/tutorials/vi/vi-in-10-1.html & http://www.openvim.com/.

  8. You can create one if none exists by opening a terminal and entering the following command:
    vi ~/.bash_profile
    
  9. Edit the file by pressing I to enter the edit mode, and add the following entries to the end of the file:
    export DEV_HOME=/Users/Amr/dev
    export APPS_HOME=$DEV_HOME/apps
    export WORK_HOME=$DEV_HOME/myworkspaces
    

    Save by pressing Esc and then :wq

How it works…

Creating environment variables will help you to map everything accordingly, and will give you a structured development environment for your IDEs and workspaces. This will also help you in your future applications, as you will be able to locate all the information you need in one place, and you will know where you should go fast and easy.

After you finish creating your environment variables and all the directory structures, you should be able to start installing the software, and we will start with the JDK.