Java EE 6 SDK |
The sample applications depend on the following software:
Due to these dependencies, you must perform some one-time setup tasks before building and running the individual samples.
Note: In the following instructions, <javee.home>
refers to the directory where the Java EE SDK is installed; for example, C:\glassfish3
.
If JDK version 1.6.0_16 is not already on your system, you must download and install it. The download is available at the Java SE Downloads page.
If Apache Ant version 1.7.1 is not already installed on your system, you can download and install it as an add-on using the Update Tool utility included in the Java EE SDK. For instructions about using Update Tool, see Extending Enterprise Server in Sun GlassFish Enterprise Server v3 Administration Guide.
The configuration file for the Java Blueprints build system used by the samples is:
<javee.home>/samples/bp-project/build.properties
.
Edit the properties in this file to reflect your installation:
Property Name | Description | Examples |
---|---|---|
javaee.home |
The directory where the Java EE 6 SDK/application server is installed. | C:\glassfish3 |
javaee.server.name |
Host name of system where Java EE 6 SDK/application server is installed. | localhost |
javaee.server.port |
The port number of the application server. | 8080 |
javaee.server.username |
The administrator username specified for the
application server. If no username is specified, use the value
anonymous . |
admin |
javaee.server.passwordfile |
The path to a file containing the admin password
for the Java EE 6 SDK. The password file needs to be in the following
format:
Replace <admin-password> with the admin password of
the application server. For
|
C:\glassfish3\glassfish\samples\ |
javaee.adminserver.port |
The port number for admin server. | 4848 |
proxy.host |
The host name of your HTTP proxy server, if the system running Java EE 6 SDK is behind a firewall. Leave blank otherwise. | myproxy.mydomain |
proxy.port |
The port number of your HTTP proxy server, if the server running Java EE 6 SDK is behind a firewall. Leave blank otherwise. | 9090 |
See Using Java DB with Sample applications for information on configuring the built-in Java DB database and corresponding JDBC resources.
After performing the one-time setup tasks, you can build and run a sample application as follows:
set PATH=C:\Program Files\Java\jdk1.6.0_16;%PATH%
set PATH=C:\Program Files\Java\jdk1.6.0_16\bin;%PATH%
set PATH=C:\glassfish3\ant;%PATH%
set PATH=C:\glassfish3\ant\bin;%PATH%
<javee.home>\bin
directory
and then use the asadmin
utility to start the application server
and the Java DB database:
asadmin start-domain
asaadmin start-database
You can open the sample applications as projects in the NetBeans 6.8 IDE. To do so, follow these steps after downloading and installing NetBeans 6.8 from the NetBeans Download page:
netbeans_jdkhome
property in the
<netbeans.home>\etc\netbeans.conf
file.<javaee.home>\glassfish\samples\javaee6
directory and then to the appropriate sample project.Run
.Note: It is possible that the sample may not work correctly because of NetBeans caching. In that case, perform the following steps:
Copyright © 1997-2011 Oracle and/or its affiliates. All rights reserved.