javac doesn't work

Reply

Join Date: Jul 2005
Posts: 13
Reputation: gzero14 is an unknown quantity at this point 
Solved Threads: 0
gzero14 gzero14 is offline Offline
Newbie Poster

javac doesn't work

 
0
  #1
Jul 5th, 2005
I've tried using the javac command inside the command prompt but it says "javac not recognized as an internal or external command". the java command works perfectly fine.

On the other hand, I can compile stuff using the Textpad program.
Anyone know why this might be happening?

Version of Java SDK: 1.5.0_04
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 2,108
Reputation: server_crash is on a distinguished road 
Solved Threads: 18
server_crash server_crash is offline Offline
Postaholic

Re: javac doesn't work

 
0
  #2
Jul 5th, 2005
You haven't set your classpath.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 13
Reputation: gzero14 is an unknown quantity at this point 
Solved Threads: 0
gzero14 gzero14 is offline Offline
Newbie Poster

Re: javac doesn't work

 
0
  #3
Jul 5th, 2005
Do you mean the thing in environmental variables?

".;%classpath%.;C:\Program Files\Java\jdk1.5.0_04\lib\tools.jar"
From reading some other topics...and doing that fixed the thing with none of my java applications working properly. But javac still doesn't work.
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 2,108
Reputation: server_crash is on a distinguished road 
Solved Threads: 18
server_crash server_crash is offline Offline
Postaholic

Re: javac doesn't work

 
0
  #4
Jul 5th, 2005
Put a period at the end of your classpath so that it looks like this:

  1. .;%classpath%.;C:\Program Files\Java\jdk1.5.0_04\lib\tools.jar.


I must warn you though, recently I've learned that setting the classpath variable to tools.jar isn't the best way to do it anymore. It will still work, but it's not recommended by professionals.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 13
Reputation: gzero14 is an unknown quantity at this point 
Solved Threads: 0
gzero14 gzero14 is offline Offline
Newbie Poster

Re: javac doesn't work

 
0
  #5
Jul 5th, 2005
I guess I'll do that for now then, but what's the better way?

Edit: javac still doesn't work. In fact, I lost the ability to run java applications so I'm changing it back...
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 2,108
Reputation: server_crash is on a distinguished road 
Solved Threads: 18
server_crash server_crash is offline Offline
Postaholic

Re: javac doesn't work

 
0
  #6
Jul 5th, 2005
I'm not sure why that's not working, unless you have more to your classpath. If that's the case, be sure the seperate using a semi-colon(.

The other(better) way...I really don't know much about it.
See this thread for a little help:

http://www.daniweb.com/techtalkforums/thread26307.html

I really can't help you much with that though. I'm sure Mr. Wenting would be willing to help if you ask.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 13
Reputation: gzero14 is an unknown quantity at this point 
Solved Threads: 0
gzero14 gzero14 is offline Offline
Newbie Poster

Re: javac doesn't work

 
0
  #7
Jul 5th, 2005
Hmm that way works, lets me run the app and stuff but the javac command still refuses to work...I don't think it has anything to do with the classpath if I'm doing that right. I guess I'll try restarting or something.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 13
Reputation: gzero14 is an unknown quantity at this point 
Solved Threads: 0
gzero14 gzero14 is offline Offline
Newbie Poster

Re: javac doesn't work

 
0
  #8
Jul 5th, 2005
Eh where's the edit button...how'd I edit it last time ._.;;

Anyways the restart did it. Though I wonder why the java command would work while javac wouldn't...*shrug*
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 2,108
Reputation: server_crash is on a distinguished road 
Solved Threads: 18
server_crash server_crash is offline Offline
Postaholic

Re: javac doesn't work

 
0
  #9
Jul 5th, 2005
No, it has to be one of your path variables. The reason it doesn't work is because it cannot find javac.


Anyways, I'm thinking it could be your Path variable(not the classpath since it looks correct). Please post your PATH variable. You might be pointing it to the jdk directory when you should be pointing it to the jre directory.


The path variable is located at the same place the classpath is, or you can type this at the command prompt:

echo %PATH%
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 2,108
Reputation: server_crash is on a distinguished road 
Solved Threads: 18
server_crash server_crash is offline Offline
Postaholic

Re: javac doesn't work

 
0
  #10
Jul 5th, 2005
Originally Posted by gzero14
Eh where's the edit button...how'd I edit it last time ._.;;

Anyways the restart did it. Though I wonder why the java command would work while javac wouldn't...*shrug*

Sorry, looks like we posted at the same time. Some times you do need to restart your computer for changes to take affect. The java command just invokes the JRE, so no problem should arise there. Anyways, glad you got it fixed.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC