Solved

jdk in linux

Posted on 2001-06-27
6
195 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
Comment Utility
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
Comment Utility
U should add current directory to ur classpath.
U can do this by
export CLASSPATH=$CLASSPATH:.
0
 
LVL 1

Expert Comment

by:sumeetsh
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Updating Java 9 87
Modeling a class in java 5 31
solarwind tftp server 2 30
micro services spring boot application error 3 23
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…
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.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

744 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

18 Experts available now in Live!

Get 1:1 Help Now