The only projects that can be exported as a JAR file or set of JAR
files are Java and SAS Java Projects that have a class with a
public
static void main(String[])
.
To export a SAS Java
Project, follow these steps:
-
Select
FileExport.
-
Select
SAS
Java Project as the export destination, and then click
Next.
-
Select the project to
deploy.
All of the projects
available in the current workspace are listed. Invalid projects are
indicated when selected.
-
Choose the resources
to include in the output JAR file.
Compiled code is not
included in the tree. Items that are on the project source path are
checked by default.
-
Select the
Include
Source Code check box if you want the project source
code to be included in the exported JAR file.
-
Specify the
Deployment
directory.
The JAR file containing
the project code and other necessary files will be placed in this
directory.
-
Specify the
Jar
Name and then click
Next.
-
Select the
Use
SAS Repository check box if you want to create a JAR
file that runs against a copy of the SAS Versioned Jar Repository
that is already on the target machine.
If you do not deploy
against a SAS Versioned Jar Repository, then all the required JAR
files from the project and any dependencies from the SAS Versioned
Jar Repository are copied into the deployment directory. You can then
copy all the JAR files to a deployment location if necessary.
If you do deploy against
a SAS Versioned Jar Repository, the project contents, a picklist called
SASRepositoryConfig
,
and a script (in batch and shell versions) are copied to the deployment
directory. The scripts use as their base name the name of the exported
JAR filename. You must either edit the script and specify the location
of the SAS Versioned Jar Repository on the target machine, or pass
the location as a command-line argument. For example:
exportedJarName.sh repositoryLocation
The script executes
the application using the SAS launcher to load the JAR file dependencies
from the target machine's SAS Versioned Jar Repository.
-
Select the
Main
class that starts your application. The main class must
reside in your project.
-
-
Select the
Save
Deployment Descriptor in Project check box if you want
to capture the current export settings.
-
In the
Manifest
Location field, specify the path to the manifest file
relative to the project.
The manifest file can
be in any directory and with any filename. However, when added to
the exported JAR file, the manifest information is placed in the file
META-INF\MANIFEST.MF
.
If the specified manifest
file already exists, the export overwrites any existing properties
in the file that conflict with the properties needed to run the application
properly. The overwriting occurs at the level of individual properties;
the entire file is not overwritten.
-
Click
Next and
review the export settings, and then click
Finish.
The project is exported
to the specified deployment directory. Depending on the options that
you chose, you might need to take additional configuration steps to
run the project.
If the SAS Java project
requires a JAAS configuration file, such as one that executes a Stored
Process, then the JAAS configuration file must be manually copied
to the deployment directory. In addition, the Java command in the
startup batch script must be updated to include the Java System property
shown in the
launchParameters.txt
file.
Ensure the value of the property is modified to reference the copied
JAAS configuration file.