pete

Setting directory for CLASSPATH

Hi,

I would like to know if there is a way to specify a directory when specifying the Classpath. There is a button to add Jar files, but when I select a directory, the Ok button stay disabled.

I would like to have, say
. (The installation directory)
modules (A directory with configuration files)

added to the jars and zip needed by my application.

Any work around.

Bravo. It is a very nice product.


Thanks,
Pierre
Cata
Posts: 638
Joined: Thu Apr 10, 2003 7:37 am
Contact: Website

Hi Pierre,

Your are right, adding a directory to the classpath is not supported yet. We are planning this feature for a future version.

The only work around I can think of is in the way those files are read in your Java programs. Instead of relying on having them in your classpath, you could look for them explicitely.

First find out the path to one of your .class files:

String name = "com/mycomp/myapp/Main.class";
String path = getClass().getClassLoader().getResource(name).toString();

Then look for the jar:

int index = actualPath.indexOf(".jar");

And from there construct the path to your resource files.

Regards,
Cata
Catalin Rotaru - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Biff

Hi there,

I've just come across the same problem with needing a directory on my classpath. I don't suppose there's been any progess on adding them yet?

The other minor thing I would like to be able to do is specify the TARGETDIR in the JVM parameters, which doesn' t seem to get resolved in the ini file generated.

cheers, Biff
Cata
Posts: 638
Joined: Thu Apr 10, 2003 7:37 am
Contact: Website

1) will be added in the 2.4 version

2) should get resolves, as long as you don't forget the square brackets ([TARGETDIR] and quotes around the name=value pair, as white spaces may appear
Catalin Rotaru - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Biff

Ah yes, thanks. Darnedcase-sensitivity trips me up again.

Return to “Common Problems”