Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to define new classpath of libraries while making jar files with ant

807591May 8 2008
I am useing eclipse and ant and trying to make a jar file. I have used some external jar files. I have managed to add external jar files to my jar. But Still I have a problem. In my project all libraries in lib folder. But when I put them into jar file. They are in the root folder.Classpath has changed and It couldn't find the class path.

Is there any body knows how to define a new class path for external libraries with ANT. or How can I put my libraries into a lib folder in jar ?? I think both of them would solve my problem.

thanks in advance.


My code is like that, I think it requires a little modification
<target name="jar">
        <mkdir dir="build/jar"/>    	
        <jar destfile="build/jar/Deneme.jar" basedir="build/classes" >        	
            <manifest>
                <attribute name="Main-Class" value="${main-class}"/>               	
            </manifest>        	
        	<fileset  dir="${lib.dir}" includes="**/*.jar"/>      	
        </jar>
    </target>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 5 2008
Added on May 8 2008
0 comments
190 views