Java Project: Addings Jars to Classpath Dynamically - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

ericl
Posts: 1
Joined: Mon Mar 05, 2007 3:55 pm

Java Project: Addings Jars to Classpath Dynamically

Hi all,

We use AdvancedInstaller for our Java application. We generate the installer executable daily during our nightly build.
Our project uses quite a few third part jar files. Using the Synchronized Folder property, we automatically add all third part jars to our library folder (Project Definition/Files and Folders). However, we can only add given jars to our classpath (Project Definition/Java Products/Classpath). That means that if we add a jar to our third part jars, this file is automatically (i.e. without modifying the Advanced Installer setup file) added to our distributed files. However, this jar is not automatically added to our application's classpath.
This is obviously a problem for us since we try to reduce as much as possible all manual tasks in our build process.
So, is it possible to dynamically add all jars in a given folder to the classpath?
Or do you have another way of solving our issue? If necessary we could modify the AIP file on the fly by adding the right classpath. If so, could you please tell us which XML content we should modify?

Many thanks in advance

Best regards

Eric
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Eric,

When you build the jar file you can specify in its manifest (classpath entry) the third part jar files.

Hope this helps. Please let us know if this is not a solution for you.

Regards,
Gigi
_______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”