Solved

jdk in linux

Posted on 2001-06-27
6
196 Views
Last Modified: 2013-11-23
i installed jdk in linux.i set the classpath also in the bashrc file,while i am compiling my program it is compiling good,but when i run my program it is showing that
Exception in thread "main" java.lang.NoClassDefFoundError:classname

my jdk version is 1.3.1
linux version is 7.0

any suggestions are welcome
0
Comment
Question by:nagaraj2k
6 Comments
 
LVL 1

Accepted Solution

by:
fauzdar earned 100 total points
ID: 6233977
you also need to define the working directory where the generated class files will be located. eg export CLASSPATH=/home/yourdir/javadir/xyz.class

Exception NoClassDefFoundError means it is unable to locate the class file that you are trying to run. for that you have to define the working directory also in that CLASSPATH
0
 
LVL 2

Expert Comment

by:k_suchdeva
ID: 6234323
U should add current directory to ur classpath.
U can do this by
export CLASSPATH=$CLASSPATH:.
0
 
LVL 1

Expert Comment

by:sumeetsh
ID: 6264153
hi
Did u log off after setting the classpath.
Its effective only if login again or run .profile file.
Regatds
Sumeet

0
 

Expert Comment

by:CleanupPing
ID: 9062019
nagaraj2k:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 9253885
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:


[points to fauzdar]


Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
sudhakar_koundinya
EE Cleanup Volunteer
---------------------
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post your concern in THIS thread.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now