• Post Reply Bookmark Topic Watch Topic
  • New Topic

javac file not found even after installing jre  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey hie,
i just installed jdk1.6.0_04 into c drive
i was trying to set path by writing this, C>set path="C:\Program Files\Java\jdk1.6.0_04\bin"
and when i tried to compile a program of Pythagoras triplets by writing in command prompt , javac Pythagoras.java
it shows an error that javac:file not found : pythagoras.java
i tried various methods and do everything that i can but it shows the same..
please help me
 
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello parth rajgor,

Welcome to CodeRanch!

Firstly, I would suggest to edit the title of your post (because javac is part of jdk, not jre).

Secondly, I'm not sure if Windows does care about env variables' cases, but you are supposed to set PATH variable (not path variable). So, once you set it, just type below command:
echo %PATH%
If it shows the JDK directory, then javac should work.

I would suggest to edit Windows' system variable (PATH) instead of each time doing this 'set path' thing in command prompt.

I hope this helps.
 
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
parth rajgor wrote:it shows an error that javac:file not found : pythagoras.java

The assumption Anayonkar made was on the basis of the most commonly seen problem. In your case, you don't ned to make any changes to the PATH (or path) as the system is able to locate and execute javac.exe.

Your problem is that javac.exe is unable to locate your source file pythagoras.java. Is it in the current working directory?

If you enter the dir command, does the file show up in the list?
 
Anayonkar Shivalkar
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

My bad... I didn't read it carefully.

Sorry for wrong reply
 
Marshal
Posts: 56608
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, did you write Pythagoras or pythagoras? They might be different, but this is less likely to be a problem for javac on Windows® than on *nix.
 
Campbell Ritchie
Marshal
Posts: 56608
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apologies accepted. I have made sillier mistkes than that myself.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!