Howto add a directory to the classpath?

How could I add some directories to the existing classpath of a junit configuration? I cannot at -cp ... to the VM parameters because it will override the existing classpath .

2 comments
Comment actions Permalink

Open Settings
Under project Settings, select "project settings (1)"
On the left, select "modules"
Select the desired module
Select the "Sources" tab
In the tree structure, find the directory you want to add. Then either add as a source or test source.

If the directory you want to is not within your project structure, typically you would create a library and attach the jars & classes desired.

0
Comment actions Permalink

First, I'd like to say that the directory (let's call it directory H) I want to add to the classpath doesn't contain any class. Actually, it contains some files like log4j.properties ....

My java files will be compiled and put in a jar file, then this jar file will be run on another machine where there is the directory H already.

If I do like this
Open Settings Under project Settings, select "project settings (1)" On the left, select "modules" Select the desired module Select the "Sources" tab In the tree structure, find the directory you want to add. Then either add as a source or test source. ]]>
then the jar file will contains my directory H. And that is not what I want. I'm lazy enough to write an Ant script to compile my stuff and put it in a jar file without the directory H (what I usually do is going to the `out' directory of the project, zip everything and rename the zip file to jar and send out the jar file).

0

Please sign in to leave a comment.