LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 11-23-2008, 02:18 AM   #1
jm-31
LQ Newbie
 
Registered: Nov 2008
Posts: 1

Rep: Reputation: 0
Junit error with $CLASSPATH set on Slack12.0


Hi all,

OS:Slackware12.0



I'm trying to install junit-4.5.jar and I've the following message:


xxxx@xxx:/usr/local/src:$] java junit-4.5.jar
Exception in thread "main" java.lang.NoClassDefFoundError: junit-4/5/jar
Caused by: java.lang.ClassNotFoundException: junit-4.5.jar
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:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: junit-4.5.jar. Program will exit.



In ~/.bashrc , some lines:


## CLASSPATH environment variable ##

CLASSPATH=/usr/local/src/junit-4.5.jar:/usr/local/src/juni
t-dep-4.5.jar:$CLASSPATH

export CLASSPATH




## Junit ##

JUNIT_HOME=/usr/local/src
PATH=/usr/local/src:$PATH

export JUNIT_HOME PATH



## Java ##

JAVA_HOME=/usr/local/src/jdk1.6.0_10/bin
JAVAC=$JAVA_HOME/javac
PATH=$JAVA_HOME:$PATH

LD_LIBRARY_PATH=$JAVA_HOME/lib

export JAVA_HOME JAVAC PATH LD_LIBRARY_PATH


Any idea?

Thks a lot.

jm
 
Old 11-23-2008, 07:43 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,910

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Quote:
xxxx@xxx:/usr/local/src:$] java junit-4.5.jar
To run a jar file you should use the "-jar" option:
Code:
xxxx@xxx:/usr/local/src:$] java -jar junit-4.5.jar
 
  


Reply

Tags
slackware12


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to set CLASSPATH mohama Programming 8 12-17-2005 03:17 AM
How to set the CLASSPATH environment variable Rodotheos Programming 3 06-20-2005 04:30 AM
How to set classpath for jdk jolly Linux - Software 5 05-01-2003 08:48 AM
How to set classpath for jdk jolly Linux - Software 4 05-01-2003 08:24 AM
How to set classpath for java jolly Linux - Software 3 04-22-2003 10:02 PM


All times are GMT -5. The time now is 03:26 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration