LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-29-2006, 09:38 PM   #1
Lakshika
LQ Newbie
 
Registered: Mar 2006
Posts: 5

Rep: Reputation: 0
Question java.lang.ClassNotfoundException


I installed jdk1.5.0 in my Mandrake 10.0

configured
/etc/profile.d/java.sh
/etc/profile

with path and classpath properly
when I type
#]javac works properly

#]java in e shell it works but doesn't seems to catch the class file.
always throws

java.lang.classnotfoundexception;

can any one plese help me to get this properly configured.

Further I have installed netbeans 4.1 and tomcat4.0 that works perfectly. the only problem is e above
 
Old 03-30-2006, 01:39 AM   #2
trevelluk
Member
 
Registered: Nov 2003
Location: Bristol, UK
Distribution: Debian Lenny, Gentoo (at work)
Posts: 388

Rep: Reputation: 32
It sounds to me as though your CLASSPATH environment variable doesn't contain the current directory (i.e. ".").
If the following command works correctly, I'd say this is almost certainly the case:

java -classpath .:$CLASSPATH SomeClass

Hope this helps!
 
Old 03-31-2006, 06:44 AM   #3
Lakshika
LQ Newbie
 
Registered: Mar 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Thank you
trevelluk

I'm sorry I have not stated the error correctly

it is much like this...

//files in my home
testj1.java
testj1.class
//after running

[lakshika@localhost lakshika]$ java testj1
Exception in thread "main" java.lang.NoClassDefFoundError: testj1
[lakshika@localhost lakshika]$


I'll try out your solution and tell you.Right now I’m not in linux
 
  


Reply


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
java exception: java.lang.NoClassDefFoundError kath Programming 12 05-11-2006 04:37 AM
java.lang.NullPointerException ?? dansawyer Linux - Software 5 02-20-2006 11:00 PM
java.lang.NoclassDefFoundError rlnd Programming 5 02-18-2006 04:54 AM
java.lang.InstantiationException: java.sql.Connection poeta_boy Programming 2 07-06-2005 08:26 PM
java.lang.NoSuchMethodException: rulirahm Linux - Networking 2 05-02-2005 01:30 AM


All times are GMT -5. The time now is 04:46 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration