Skip to main content
This revision made August 02, 2013 22:46, by ievans

The Java EE 7 Tutorial FAQ


Installing the Tutorial


Installing the Tutorial from a GlassFish 4.0 Install

The Tutorial is included by default in the Java EE 7 SDK, which includes GlassFish 4.0. If you installed a standalone version of GlassFish 4.0, you can install the Tutorial, but you first need to activate the Java EE SDK publisher in the Update Tool.

  1. Run the Update Tool installed with GlassFish 4.0.
  2. In the Application Images list, select GlassFish 4, then click Edit Properties in the Image Details pane.
  3. Under Software Sources, check Enabled next to the release.javaeesdk.oracle.com Publisher, then click Ok.
  4. Select Available Updates under the GlassFish 4 application image. You will now see the Java EE 7 Tutorial component listed.
  5. Select Java EE 7 Tutorial and click Install Marked Components.
  6. Read the license agreement and click Accept. The Update Tool will download and install the Java EE 7 Tutorial.

Working with Maven


Building and Running the Examples From A Non-Default Install Location

The Tutorial's Maven build system uses Cargo to deploy applications to GlassFish. The configuration of Cargo in the Tutorial assumes that the default Java EE 7 SDK install location is being used. On Windows platforms, this is c:\\glassfish4. On Unix platforms, this is $HOME/glassfish4.

If you've installed the SDK to a non-default location, you must define the glassfish.home property to point to the correct location in order to deploy applications using Cargo. There are two ways to do this. The preferred way is to create and activate a profile in your Maven settings.xml file.

1. If you don't already have one, create a settings.xml file in your Maven users directory, $HOME/.m2. 2. Open $HOME/.m2/settings.xml in a text editor, then add and activate a new profile. The following shows an example that sets glassfish.home to d:\\glassfish4.

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <profiles>
    <profile>
      <id>non-default-glassfish</id>
      <properties>
        <glassfish.home>d:/javaee7sdk</glassfish.home>
      </properties>
    </profile>
  </profiles>
  <activeProfiles>
      <activeProfile>non-default-glassfish</activeProfile>
  </activeProfiles>
</settings>
3. Save settings.xml.

4. Make sure GlassFish is running, then build and run an example application.

You can also edit the glassfish.home property defined in <glassfish.home>/docs/javaee-tutorial/examples/pom.xml. This is not recommended, however, as this file will be overwritten on subsequent updates of the Tutorial.

Using the Tutorial in a Proxied Network Environment

When you run the Tutorial examples for the first time, the Maven build system will download the required Maven plugins from the central Maven repository. If your network is behind a proxy, you need to configure Maven to use the network proxy server to access the repository. See the Maven documentation for information on configuring Maven to use a proxy.

Difference compared to previous revision
<span><span style="text-decoration:line-through;color:red">= </span><span style="text-decoration:underline;color:green"><h1></span>The Java EE 7 Tutorial FAQ<span style="text-decoration:underline;color:green"></h1></span> __TOC__ <span>
 
 
Close
loading
Please Confirm
Close