Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 17th, 2005, 07:27 AM
maralbjo maralbjo is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 13 maralbjo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 49 m 27 sec
Reputation Power: 0
Classpath - How to make my computer find java.exe and javac.exe

I have the following problem:

I can run and compile java files by supplying the entire filepath like this:

"C:\ProgramFiles\j2sdk1.4.2\bin\java myclass"

but not by just writing: "java myclass" (which gives me the following error msg: Exception in thread "main" java.lang.NoClassDefFoundError)

I have in my systems variables (user) the following value for PATH:

"C:\ProgramFiles\j2sdk1.4.2\bin\;"

Why can't I just write java and javac??

Any help appreciated.

Reply With Quote
  #2  
Old May 17th, 2005, 07:56 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,886 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 19 m 35 sec
Reputation Power: 14
Do you need a space between "ProgramFiles" ?

It sounds like you're picking up a java.exe in the PATH, otherwise you would get "bad command or filename"
Make sure there's no other Java bin folders in your path.

Reply With Quote
  #3  
Old September 29th, 2005, 04:25 AM
Icon's Avatar
Icon Icon is offline
Command Line Warrior
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Sep 2005
Posts: 1,021 Icon User rank is Private First Class (20 - 50 Reputation Level)Icon User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Weeks 7 h 49 m 32 sec
Reputation Power: 11
You do not get that error because java.exe is not found, you get it because your class file is not found. You should add the directory to your classpath or start java with -classpath /something

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > Classpath - How to make my computer find java.exe and javac.exe


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap