Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Exception in thread "main" java.lang.NoClassDefFoundError:

Posted on 2011-02-21
4
Medium Priority
?
455 Views
Last Modified: 2012-06-21

i getting above error while trying to execute the sample java programe.

Compilation went thru fine.

java environment details of my PC  as below ........... Please advice the solution
------------------------------------------------

C:\>path
PATH=C:\Program Files\Java\jdk1.6.0_21\bin;C:\jdevstudio10133\jdk\bin;C:\OracleF
MW\as_1\bin;D:\dev10gHome\jdk\jre\bin\classic;D:\dev10gHome\jdk\jre\bin;D:\dev10
gHome\jdk\jre\bin\client;D:\dev10gHome\jlib;D:\dev10gHome\bin;D:\dev10gHome\jre\
1.4.2\bin\client;D:\dev10gHome\jre\1.4.2\bin;C:\orant\bin;C:\WINDOWS\system32;C:
\WINDOWS;C:\WINDOWS\System32\Wbem;C:\orant\jdk\bin;C:\Program Files\Windows Imag
ing\;C:\Program Files\Investintech.com Inc\PDF2Excel;C:\Program Files\QuickTime\
QTSystem\;C:\OracleFMW\as_1\opmn\bin;C:\OracleFMW\as_1\opmn\lib;C:\OracleFMW\as_
1\perl\bin;C:\Program Files\Java\jdk1.6.0_21\bin;C:\jdevstudio10133\jdk\bin;D:\d
ev10gHome\BIN;;C:\Program Files\Java\jre6\bin

C:\>echo %CLASSPATH%
.;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;C:\jdevstudio10133\jdbc\lib;C:\j
devstudio10133\jdbc\lib\ocrs12.jar;C:\jdevstudio10133\jdbc\lib\ojdbc14.jar;C:\jd
evstudio10133\jdbc\lib\ojdbc14dms.jar;C:\jdevstudio10133\jdbc\lib\orai18n.jar;C:
\jdevstudio10133\jlib\activation.jar;C:\jdevstudio10133\jlib\javamailintegration
.jar;C:\jdevstudio10133\jlib\mail.jar;C:\jdevstudio10133\lib\servlet-api.jar;D:\
JavaProg;

C:\>echo  %JAVA_HOME%
 C:\Program Files\Java\jre6

C:\>
0
Comment
Question by:mac_g
[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
4 Comments
 
LVL 36

Expert Comment

by:mccarl
ID: 34942251
What is the program that you are trying? What command are you using to try and run it?
0
 
LVL 5

Expert Comment

by:jaiminpsoni
ID: 34942268
Is the class that you are trying to load is part of any package or the default package?

I assume your class is in d:\JavaProg. Does it try to load any other class?

Please attach your sample program, that will help investigate this.
0
 
LVL 1

Accepted Solution

by:
Tittie earned 750 total points
ID: 34942459
Set you'r class path where the JDK 's installed.  Right click on my computer go to Advanced tab. Then Select Environment Variable. On System variable section Edit the path.

insert a semicolon then write the absolute path where the JDK 's Installed in my case it case :

D:\oracle\product\10.2.0\client_1\bin;D:\oracle\product\10.2.0\db_1\bin;D:\Program Files\ImageMagick-6.6.6-Q16;D:\Program Files\CollabNet Subversion Client;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;D:\Program Files\Intel\DMIX;D:\Program Files\TortoiseSVN\bin;D:\Program Files\Java\jdk1.6.0_10\bin

Refer to:http://download.oracle.com/javase/1.5.0/docs/tooldocs/windows/classpath.html

For Solarie and Linux refer to;
http://download.oracle.com/javase/tutorial/essential/environment/paths.html
0
 

Author Closing Comment

by:mac_g
ID: 35065940
thanks
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This video teaches viewers about errors in exception handling.
Suggested Courses

610 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