Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

Install Junit

Thread view: 
jimmi1311 - 20 Sep 2006 09:11 GMT
Hey anyone

A have a problem with Junit. I have installed it and added it to my
CLASSPATH like this:
C:\junit\; C:\junit\junit-4.1.jar

But when I try to run the test it fail like this:
C:\>java org.junit.runner.JUnitCore org.junit.tests.AllTests
Exception in thread "main" java.lang.NoClassDefFoundError:
org/junit/runner/JUnitCore

I'm running Windows XP.

I have restartet Windows after I have changed the CLASSPATH.

Any help??

Kind regards
Jimmi Wolff
Simon - 20 Sep 2006 09:29 GMT
> Hey anyone
>
> A have a problem with Junit. I have installed it and added it to my
> CLASSPATH like this:
> C:\junit\; C:\junit\junit-4.1.jar
           ^
Try to remove the blank.

Cheers,
Simon
jimmi1311 - 20 Sep 2006 10:07 GMT
Simon skrev:
> > C:\junit\; C:\junit\junit-4.1.jar
>             ^
> Try to remove the blank.
>
> Cheers,
> Simon

It helped, tahanks. But now I get a new problem:

C:\> java org.junit.runner.JUnitCore org.junit.tests.AllTests
Exception in thread "main" java.lang.UnsupportedClassVersionError:
org/junit/run
ner/JUnitCore (Unsupported major.minor version 49.0)
       at java.lang.ClassLoader.defineClass0(Native Method)
       at java.lang.ClassLoader.defineClass(Unknown Source)
       at java.security.SecureClassLoader.defineClass(Unknown Source)
       at java.net.URLClassLoader.defineClass(Unknown Source)
       at java.net.URLClassLoader.access$100(Unknown Source)
       at java.net.URLClassLoader$1.run(Unknown Source)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(Unknown Source)
       at java.lang.ClassLoader.loadClass(Unknown Source)
       at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
       at java.lang.ClassLoader.loadClass(Unknown Source)
       at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Can anyone fix that?

Kind regards
Jimmi W.
Thomas Weidenfeller - 20 Sep 2006 10:19 GMT
> C:\> java org.junit.runner.JUnitCore org.junit.tests.AllTests
> Exception in thread "main" java.lang.UnsupportedClassVersionError:
> org/junit/run
> ner/JUnitCore (Unsupported major.minor version 49.0)

Your JDK and JRE versions don't match or at least JUnit was compiled
with a newer compiler. Use the same releases, or try to compile
everything from scratch with with the -target option (and -source and
-bootclasspath) for your older JRE. The later might fail if your source
code uses newer Java features and APIs.

/Thomas
Signature

The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/

Chris Uppal - 20 Sep 2006 10:19 GMT
> Exception in thread "main" java.lang.UnsupportedClassVersionError:
> org/junit/run
> ner/JUnitCore (Unsupported major.minor version 49.0)

That means that you are attempting to load a class, apparently
org.junit.runner.JUnitCore, which has been compiled by a 1.5 compiler and is
intended to run on a 1.5 JVM, into an older JVM.  If you can't, or don't want
to, update your platform, and can't find a version of JUnit compiled for that
platform (presumably 1.4 or 1.3), then you'll have to rebuild JUnit from source
yourself.

   -- chris
Greg R. Broderick - 23 Sep 2006 19:05 GMT
"jimmi1311" <wolff13@gmail.com> wrote in news:1158743246.661051.137310
@m7g2000cwm.googlegroups.com:

> Simon skrev:
>> > C:\junit\; C:\junit\junit-4.1.jar ^
[quoted text clipped - 9 lines]
> org/junit/run
> ner/JUnitCore (Unsupported major.minor version 49.0)

Your version of JUnit was compiled with JDK 1.5.0, and you are trying to run
it with an older version of the JRE.

Solutions:

1.  upgrade to JDK 1.5.0 on your development platform

or

2.  download an older version of JUnit that does not require Java 1.5
features.  JUnit 3.8.x versions will run under JDK/JRE 1.4.

Cheers
GRB

Signature

---------------------------------------------------------------------
Greg R. Broderick            gregb.usenet200609@blackholio.dyndns.org

A. Top posters.
Q. What is the most annoying thing on Usenet?
---------------------------------------------------------------------



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.