Solved

jdk in linux

Posted on 2001-06-27
6
201 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

732 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