Home > Archive > Java Help > November 2005 > cant's compile with javac
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
cant's compile with javac
|
|
| Ido.Yehieli@gmail.com 2005-11-28, 7:58 am |
| Hi, whenever I try to compile something with javac from the command
prompt (windows XP) i get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError:
com/sun/tools/javac/Main
even if I just write "javac" without a file to compile i get the same
error.
The only time when i works correctly is when I'm in the bin directory
that contains javac, the i can compile everything. If i change to a
different directory it doesn't work and i get the afordmentioned error.
one more thing - when i compile from eclipse it works, i only get it
when manually compiling for the command prompt.
I'm using version 1.5 update 5 (the last one) but it happened with
earlier versions as well (1.5 update 1, update 2, etc..)
Thanks in advance for your help.
| |
| Ido.Yehieli@gmail.com 2005-11-28, 7:58 am |
| I forgut to mention, I've added the bin directory to my PATH. I've
added:
C:\Program Files\Java\jdk1.5.0_05\bin;
to it, and that is where it is really located.
| |
| Noodles Jefferson 2005-11-28, 7:58 am |
| In article <1133127445.931575.32890@g43g2000cwa.googlegroups.com>,
Ido.Yehieli@gmail.com took the hamburger, threw it on the grill, and I
said "Oh wow"...
> Hi, whenever I try to compile something with javac from the command
> prompt (windows XP) i get the following error:
> Exception in thread "main" java.lang.NoClassDefFoundError:
> com/sun/tools/javac/Main
>
> even if I just write "javac" without a file to compile i get the same
> error.
> The only time when i works correctly is when I'm in the bin directory
> that contains javac, the i can compile everything. If i change to a
> different directory it doesn't work and i get the afordmentioned error.
> one more thing - when i compile from eclipse it works, i only get it
> when manually compiling for the command prompt.
> I'm using version 1.5 update 5 (the last one) but it happened with
> earlier versions as well (1.5 update 1, update 2, etc..)
>
> Thanks in advance for your help.
>
>
cd go/to/the/directory/where/your/javafile/is
then javac Yourfile.java
--
Noodles Jefferson
mhm31x9 Smeeter#29 WSD#30
sTaRShInE_mOOnBeAm aT HoTmAil dOt CoM
"Our earth is degenerate in these latter days, bribery and corruption
are common, children no longer obey their parents and the end of the
world is evidently approaching."
--Assyrian clay tablet 2800 B.C.
| |
| Ido.Yehieli@gmail.com 2005-11-28, 7:58 am |
| it just says:
Exception in thread "main" java.lang.NoClassDefFoundError:
com/sun/tools/javac/Main
when I dod that.
| |
| Ido.Yehieli@gmail.com 2005-11-28, 7:58 am |
| BTW when i compile with eclipse and then run "java
nameOfTheClassIWasCompiling" it works fine, just "javac
nameOfTheClassIWasCompiling.java" doesn't work
| |
| Noodles Jefferson 2005-11-28, 7:58 am |
| In article <1133129586.492674.187080@g47g2000cwa.googlegroups.com>,
Ido.Yehieli@gmail.com took the hamburger, threw it on the grill, and I
said "Oh wow"...
> BTW when i compile with eclipse and then run "java
> nameOfTheClassIWasCompiling" it works fine, just "javac
> nameOfTheClassIWasCompiling.java" doesn't work
>
>
I can't answer that one, I don't know anything about Eclipse. Yet.
--
Noodles Jefferson
mhm31x9 Smeeter#29 WSD#30
sTaRShInE_mOOnBeAm aT HoTmAil dOt CoM
"Our earth is degenerate in these latter days, bribery and corruption
are common, children no longer obey their parents and the end of the
world is evidently approaching."
--Assyrian clay tablet 2800 B.C.
| |
| Ido.Yehieli@gmail.com 2005-11-28, 9:58 pm |
| yes, tools.jar is in D:\Program Files\Java\jdk1.5.0_05\lib
| |
| Ido.Yehieli@gmail.com 2005-11-28, 9:58 pm |
| There is one more thing:
I tried temporarily renameing the directories jdk1.5.0_05 and
jre1.5.0_05 and it seems "java" comes from jre1.5.0_0 not from
jdk1.5.0_05. but my PATH include jdk1.5.0_05 not jre1.5.0_05! how is
this possible?
| |
| Roedy Green 2005-11-28, 9:58 pm |
| On 28 Nov 2005 03:37:30 -0800, Ido.Yehieli@gmail.com wrote, quoted or
indirectly quoted someone who said :
>D:\Program Files\Java\jdk1.5.0_05\bin>cd ..
>
>D:\Program Files\Java\jdk1.5.0_05>javac
You should have only one javac.exe on your Windows machine. Use "find"
to see how many you have.
See http://mindprod.com/jgloss/registry.html
to see what the Java entries in the registry should look like.
Unfortunately my site is still down. There must have been some
trouble with the move.
The fastest way to get your system up and going it to uninstall all
JREs and JDKs, and remove any remaining files. Prune the Java stuff
out of the registry and start again installing the JDK 1.5.0_05.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
| |
| Roedy Green 2005-11-28, 9:58 pm |
| On 28 Nov 2005 07:19:28 -0800, Ido.Yehieli@gmail.com wrote, quoted or
indirectly quoted someone who said :
>I tried temporarily renameing the directories jdk1.5.0_05 and
>jre1.5.0_05 and it seems "java" comes from jre1.5.0_0 not from
>jdk1.5.0_05. but my PATH include jdk1.5.0_05 not jre1.5.0_05! how is
>this possible?
There is a copy of java.exe in the windows directory that uses the
registry to find the real java.exe.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
| |
| Ido.Yehieli@gmail.com 2005-11-28, 9:58 pm |
| > You should have only one javac.exe on your Windows machine. Use "find"
> to see how many you have.
That's it! i have all the java executables in C:\WINDOWS\system32. how
did it get there? should i just delete them all?
I'll take a look at your web site aswell, when it's online again.
Thanks,
Ido.
| |
| Ido.Yehieli@gmail.com 2005-11-28, 9:58 pm |
| Ok, deleting them solvet it.
Thanks a lot to everyone who've helped!
if only the lisp community would be that newb-friendly....
|
|
|
|
|