How to provide dependent library locations (jar files) in the ant build file?

58 views
Skip to first unread message

ishtiaque hussain

unread,
Apr 1, 2014, 3:19:14 PM4/1/14
to randoop-d...@googlegroups.com
Hi, 

I am trying to run Randoop on downloaded projects from SourceForge.
I wrote an ant build file to automate the process.

But its failing with 'NoClassDefFoundError'. 

For example:
WARNING: classForName(com.imsmart.main.MMergeTIFF) yielded exception: com/sun/media/jai/codec/SeekableStream
 java.lang.NoClassDefFoundError: com/sun/media/jai/codec/SeekableStream
at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:169)
....
....

I think it's because the project has dependencies on other libraries which it cannot find.
In the above case, the class 'com.imsmart.main.MMergeTIFF' has dependency on a jar file.

How do I add the directory that has all the jar files in the classpath?
I'd really appreciate if anyone could please me on this.

Thanks,
--Ishtiaque

The ANT build file I use is as below: Please note, 'MyListOfClasses.txt' has all the list of classes, and the *.class files are under '\imsmart' folder.
-------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<project name="RUGRAT build file" default="randoop">
<!-- target: randoop -->
<target name="randoop" >
<java classname="randoop.main.Main" fork = "yes">
<classpath>
<pathelement location="..\..\..\..\..\..\..\RUGRAT-Bipul machine\Rugrat Experiments\Tools\Randoop\randoop.1.3.2.jar"/>
<pathelement path="..\..\imsmart"/>
</classpath>
<jvmarg value="-Xmx30720m"/>
<jvmarg value="-XX:PermSize=1024m"/>
<jvmarg value="-XX:MaxPermSize=1024m"/>
<arg value="gentests" />
<arg value="--classlist=MyListOfClasses.txt" />
<arg value="--output-tests=fail"/>
<arg value="--junit-output-dir=randoop-fail-min"/>
</java>
</target>
</project>
------------------------------------------------------------------------------------------------



Michael Ernst

unread,
Sep 22, 2014, 12:20:39 AM9/22/14
to randoop-developers, ishtiaque hussain
The first example in the Randoop manual, at
http://randoop.googlecode.com/hg/doc/index.html#running_randoop
shows use of the classpath argument to Randoop. This is different than
the classpath argument to the underlying JVM.

When trying to debug an Ant script, two useful tips are:
* First, run your command from the command line to ensure that it works.
* Then, run your Ant buildfile with the -d (debug) flag to ensure that
the command it runs is exactly the one that you ran from the command line.

Good luck!

-Mike

> Subject: How to provide dependent library locations (jar files) in the
> ant build file?
> From: ishtiaque hussain <ishti...@gmail.com>
> To: randoop-d...@googlegroups.com
> Date: Tue, 1 Apr 2014 14:19:14 -0500
> --
> You received this message because you are subscribed to the Google
> Groups "Randoop Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to randoop-develop...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

lequynhtr...@gmail.com

unread,
Oct 8, 2018, 12:34:16 AM10/8/18
to Randoop Developers
Hi! 

I have a similar problem. Have you fixed this error? If you fixed this error, please tell me how to fix it. It's so important for me. I thank you so much!

Vào 02:19:14 UTC+7 Thứ Tư, ngày 02 tháng 4 năm 2014, ishtiaque hussain đã viết:

Michael Ernst

unread,
Oct 8, 2018, 12:36:51 AM10/8/18
to randoop-developers
I replied to the previous email already, so you know how to proceed to diagnose the problem and produce a more useful report.
(In short, reproduce it from the command line; the Randoop developers want to help you, but they don't have time to debug your Ant scripts.)

Mike

Quỳnh Trang Lê

unread,
Oct 8, 2018, 12:48:45 PM10/8/18
to randoop-d...@googlegroups.com
Thanks for your assistance. I have fixed that errors. Thank you very much! 

Vào Th 2, 8 thg 10, 2018 vào lúc 11:36 Michael Ernst <mer...@cs.washington.edu> đã viết:
You received this message because you are subscribed to a topic in the Google Groups "Randoop Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/randoop-developers/WYwlq0YYReQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to randoop-develop...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Le Quynh Trang
Comunication and Computer Network
University of Engineering and Technology, Vietnam National Universiry
Support Group - SGuet
Phone: 0948057786
Address: Cau Giay - Ha Noi
Reply all
Reply to author
Forward
0 new messages