Solved

jdk in linux

Posted on 2001-06-27
6
197 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
stackato and cloud 4 85
print map entry 34 69
object oriented programming comparison 5 71
Which non-HTML GUI front end to use with Java? 3 22
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…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

773 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