Sagara Wijetunga | 13 Jan 16:40 2010
Picon

JUnit and Apache Ant issues

Hi all

1. I have installed JUnit-4.8.1.

CLASSPATH is set as follows:
export CLASSPATH=/usr/share/junit-4.3.1/junit-4.3.1.jar:/usr/share/junit-4.3.1

Following regression tests fails:
java org.junit.runner.JUnitCore org.junit.tests.AllTests

Exception in thread "main" java.lang.NoClassDefFoundError: org/junit/runner/JUnitCore
Caused by: java.lang.ClassNotFoundException: org.junit.runner.JUnitCore
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

2. I have installed Apache Ant-1.7.1

Build fails:
./build.sh -Ddist.dir=/opt/ant-1.7.1 dist

BUILD FAILED
apache-ant-1.7.1/build.xml:1106: The following error occurred while executing this line:
apache-ant-1.7.1/build.xml:912: We cannot build the test jar unless JUnit is present, as JUnit is needed
to compile the test classes.

(Continue reading)

lux-integ | 13 Jan 18:08 2010

Re: JUnit and Apache Ant issues

On Wednesday 13 January 2010 03:40:20 pm Sagara Wijetunga wrote:
> CLASSPATH is set as follows:
> export
> CLASSPATH=/usr/share/junit-4.3.1/junit-4.3.1.jar:/usr/share/junit-4.3.1

might be worth giving this a whirl:-
export 
CLASSPATH=$CLASSPATH:/usr/share/junit-4.3.1/junit-4.3.1.jar:/usr/share/junit-4.3.1

--

-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Wayne Blaszczyk | 14 Jan 01:01 2010
Picon

Re: JUnit and Apache Ant issues


Sagara Wijetunga wrote:

> BUILD FAILED
> apache-ant-1.7.1/build.xml:1106: The following error occurred while executing this line:
> apache-ant-1.7.1/build.xml:912: We cannot build the test jar unless JUnit is present, as JUnit is
needed to compile the test classes.
> 
> CLASSPATH is set as above.
> 
> Why Apache Ant cannot find JUnit?
> 
> Kind regards
> Sagara
> 
Have you set the ANT_HOME and JAVA_HOME environment variables correctly?
Regards,
Wayne.

Sagara Wijetunga | 14 Jan 06:06 2010
Picon

Re: JUnit and Apache Ant issues [SOLVED]


--- On Wed, 1/13/10, Sagara Wijetunga <sagaralists2 <at> yahoo.com> wrote:

> From: Sagara Wijetunga <sagaralists2 <at> yahoo.com>
> Subject: JUnit and Apache Ant issues
> To: blfs-support <at> linuxfromscratch.org
> Date: Wednesday, January 13, 2010, 11:40 PM
> Hi all
> 
> 1. I have installed JUnit-4.8.1.
> 
> CLASSPATH is set as follows:
> export
> CLASSPATH=/usr/share/junit-4.3.1/junit-4.3.1.jar:/usr/share/junit-4.3.1
> 

A small typo was the issue. 

Regards
Sagara

      
--

-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page


Gmane