Jump to content
Excelsior Forums
Sign in to follow this  
avernon

Packaging results in loss of environment CLASSPATH settings

Recommended Posts

When I build an application (whether it is an NT Service or a plain exe) the system classpath includes the environment variable settings for classpath, eg...

Classpath ivr-server.jar;icu4j_3_2.jar;commons-codec-1.3.jar;jdbcappender.jar;log4j-1.2.8.jar;truelicense1_20.jar;truexml1_20.jar;.;;E:\work\ist-tools\lib\postgres\postgresql-8.0-313.jdbc3.jar;E:\work\ivr-code-exe\jar\ivr-sample.jar

However, when I package this up for deployment, the classpath in the resulting service or application does not include the environment variable settings for Classpath

Classpath ivr-server.jar;icu4j_3_2.jar;commons-codec-1.3.jar;jdbcappender.jar;log4j-1.2.8.jar;truelicense1_20.jar;truexml1_20.jar;C:\IST\AGSvc

The "." is logically replaced with the install directory (becuase a service runs from elsewhere).

But where did the environment variable classpath settings disappear to?

Share this post


Link to post
Share on other sites

Hi,

In Java, the CLASSPATH environment variable is used only if the classpath is not specified in another way, such as "-cp" option, "-jar" option, or directly by defining java.class.path property ("-Djava.class.path" option). If the classpath is specified in one of the above ways, the CLASSPATH environment variable is ignored.

In JET, on the development system the Java classpath is not defined. Actually, it is defined automatically by appending packed resources, along with the CLASSPATH environment variable. Thus, you can easily change the classpath during development.

During packaging, in JetPackII, on the page "Resources", the final classpath is specified for the executable. After deployment, the CLASSPATH environment variable is ignored as the classpath is already defined.

By design, the distributable executable should not depend on the environment on the target system. If you would like to customize the classpath, you can redefine property java.class.path in the JetPackII, on the page Resources.

P.S. Please use exactly one of the support channels: e-mail to java@excelsior-usa.com, support form,  or this forum.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×