|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
||||
|
||||
|
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. |
|
#3
|
||||
|
||||
|
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
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > Java Development > Classpath - How to make my computer find java.exe and javac.exe |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|