• Post Reply Bookmark Topic Watch Topic
  • New Topic

install jdk cant find file  RSS feed

 
kieran pattni
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi...while doing javac hello.java at command line get message cant find file..it is in jdk bin directory..i know its not its not good practise..i just thing working first..also how do create my own folder to store files without putting in the jdk bin..at command prompt i have
C:Users\kieran7110>javac hello.java ...thank you
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kieran,
First, your question is rather confusing due to the bad English. I suggest you spend a good deal of time improving your English if you are planning on being a programmer whose primary language will be English.

Secondly, this link may help you sort out your problems.
[ August 27, 2008: Message edited by: Gamini Sirisena ]
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by kieran pattni:
hi...while doing javac hello.java at command line get message cant find file..it is in jdk bin directory..i know its not its not good practise..i just thing working first..also how do create my own folder to store files without putting in the jdk bin..at command prompt i have
C:Users\kieran7110>javac hello.java ...thank you


What your problem is depends on which file it can't find - javac or hello.java. If you copy and paste the exact error message, people will be able to help you better.
 
kieran pattni
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..sorry english is bad..early morning
window message i get

C:\Users\kieran7110>javac hello.java
javac: file not found: hello.java
Usage: javac <options> <source files>
use -help for a list of possible options

C:\Users\kieran7110>javac -version
javac 1.6.0_07

C:\Users\kieran7110>java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)
 
Ove Lindström
Ranch Hand
Posts: 326
Android Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the simple question is, if you do dir/ls on in the same directory that you try to do javac, does it contain the file hello.java.

And yes, the javac command is case sensitive.
 
Campbell Ritchie
Marshal
Posts: 56541
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gamini Sirisena:
Kieran,
First, your question is rather confusing due to the bad English. I suggest you spend a good deal of time improving your English if you are planning on being a programmer whose primary language will be English.


Please . . . that's no way to talk to another Rancher. What is more I can understand it.

You have tried to put a file into your "bin" directory, and you are correct that you ought not do that.
You know you use the "cd" (Windows and *nix (Unix/Linux)) command to move from directory to directory, eg "cd Java" moves you from your present directory to one in the same directory called Java.
You know "dir" on Windows gives a brief list of files in the current directory, and on *nix you use "ls" for a more versatile listing.
On Windows you say "A:" to get to the root folder on the floppy drive and "C:" for the root of the C drive; on *nix you say "/" for the root of the file system.
On both OSs you can say "mkdir Java" to create a directory called "Java" inside your current directory.

I hope that answers your question

CR
 
geoffrey hutton
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kieran,

If the directory that you store your *.java files is not in the PATH for Windows you will get that error. You have a couple of options at this point. For learning purposes I like to store my files in the "My Documents" folder for the user I am logged on as. In a production environment I would not do that as the folder permissions by default is for that specific user profile. For instance:

C:\Documents and Settings\ghutton\My Documents\JavaProgram>

I did this because I am lazy and my documents is in the Windows PATH variable so I can type the file name and it will find it. The other option is to add whatever directory to the PATH variable which is located in the My Computer directory. There are several good HOWTO's on the Internet for how to do this. Just do a google search for "changing PATH in windows" or something to that effect. That should clear up your issue. If not let us know

Good Luck!

Geoff
 
Campbell Ritchie
Marshal
Posts: 56541
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Geoff

I am not convinced that Kieran has a PATH problem; that would cause different error messages. Nor do I think that including My Documents in your PATH is a good idea.
My Documents is a appropriate place to store .java files, but you don't want that file in the PATH nor in the CLASSPATH; you want to navigate to that folder with the command prompt.

There is a useful page in the Java Tutorials and it has a link to instructions for setting your PATH.
 
kieran pattni
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you all...problem was at command prompt...sorted it..
 
Campbell Ritchie
Marshal
Posts: 56541
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done. What was the actual problem? That sort of thing is useful because somebody else might have the same problem in future.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!