Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need to Set Classpath

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Can anybody please tell me how to set Classpath. where do we need to set this path...

As i am getting error during execute the program. there is no error in compilation...

"Exception in thread "main" java.lang.Noclassdeffounderror"

 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Here is a good place to start.
 
Lavesh saxena
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Actually i didn't get this point...

As i have made one program & save in my path "D:\Java_Programs\"....

After that i compiled my program as below.

C:\ javac D:\Java_Programs\Example.java

after that there was no error then execute my program

C:\ java D:\Java_Programs\Example

so i got errors. its mention below

"Exception in thread "main" java.lang.Noclassdeffounderror".

Can you please help to rectify above error.

 
Ranch Hand
Posts: 580
Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
If you have set the CLASSPATH to \Java_Programs\
then the below will work
C:\ java Example


or try this..
C:\ java -cp D:\java_programs Example
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I guess the best way would be .
Go the command prompt
C:\ set classpath=<path of lib folder in your jdk ex. C:\Proram FIles\j2sdk 1.4.2\lib>;.;
The ;.; makes sure your this apth gets concanated to your existing class path.
ALso set the path in the same way but make it to pint to bin folder of jdk.
Hope it helps :-)
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Closing thread as duplicate.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic