adding to the Java Classpath

Cliff Draper <[email protected]> Fri, 24 Oct 2003 11:37:25 -0700 (PDT)
Newsgroups gmane.comp.java.netbeans.modules.projects.devel
Message-ID <[email protected]>
Hi,

I need to programatically add some jars (not to be deployed with the
project) to the classpath in my web app project.  I think this should
work:
   ClassPath cp = ProjectPath.getDesignPath(pm);
   PathResource pathR = ProjectPath.createResource(fo, project);
   cp.add(pathR);

And I get the following exception:
java.lang.UnsupportedOperationException
	at org.netbeans.spi.java.classpath.ProxyClassPath.add(ProxyClassPath.java:64)
	at org.netbeans.spi.java.classpath.ProxyClassPath.add(ProxyClassPath.java:65)

If I change getDesignPath to getBasicPath, it works, but my reading of
design path sounds more like my jars: jars which are used at compile
time, but are already deployed in the server.  Should I be using the
basic path?

Also, ClassPath.add says that it will only add the resource if it's
not there already, but by jars keep getting added anyway.

regards,
Cliff Draper    Sun Microsystems, Forte Tools
My opinions may or may not reflect those of my employer.
---------------------------- food for thought ---------------------------
All that glitters has a high refractive index.