javac file not found
hi, i am getting into java with a comprehensive book/cd.
i have done everything in the book and web-site regarding setting classpath and path, but when i try to compile using javac in ms-dos the file is not found, although i see it in that filepath dir, and have put that filepath in the new classpath and new path - i.e. c:\program files\java\jdk1.6.0_01\bin any clues will be gratefully accepted.
I have problems with classpath, so do others. Be patient as frustration will get nothing done. Since you are on win there is a start menu control that will allow setting several of these things as needed. The nomenclature is occasionally self-referential so you have to exercise patience.
What these are is "name=value" pairs, simple strings as typed on the keyboard as opposed to internal machine format data. This allows the shell to do it's job.
I tried all manner of hacks and found that sometimes the win platform was insisting that everything be in My Documents or some other user directory, it has a lot to do with what editor you are using and so on.
What book do you have? How much progress have you made? Are you stuck?
hi nicholas and thanks, in answer to your question the book is 'Teach yourself Java 6 in 21 Days'. I haven't got very far because i need to compile the first sample program, but cannot work out why it isn't. I have gone from writing programs in visual Basic 5 express edition and am also not too bad when it comes to ms-dos, so maybe you are right, the win system may fix itself in the near future, i am just trying to discover if there really is something i am doing wrong
I hope this thread could help you also
If you still cannot set the classpath on environmental variables,
better to compile it on jdk's bin folder....
Who's on first.
The title of this reply is the name of a classic comedy routine. In short, you are doing nothing wrong. The longer version is given a full depth treatment in the classic comedy routine: Who's on First? by Abbott and Costello
This is one point where I disagree with 'do not do people's homework' - but be aware you are not going to do anything in six days - other than getting a compile. I have noted from experience that the error messages the compiler issues are far more telling, and in general you just take one and go read about it in a book...
Try as first thing, putting the entire project either in My Documents or a folder created in that folder, or some folder listed in Documents and Settings - or a subfolder thereof. The next thing is one has to know where the Java stuff was installed by the installation routine. Do not put everything in the Java Virtual Machine directory, go make a directory somewhere else. Do a search for javac.exe from the shell. ( We will define the shell as anything the user can see or point at in the routine use of the computer - there are other definitions that are acceptable ) Do a 'create shortcut', then 'copy' on the shortcut that is created from the dropdown right-click and open notepad and see if it will paste anything. Sometimes this actually does something. Even if it does not you can do a properties on the shortcut that was created and get a properly constructed shortcut to the java compiler, on earlier versions you may be able to open the shortcut with notepad.
At that point, given XP or later, you can probably go to Control Panel / System / Advanced / Environment Variables / New ( I don't know if it's system or user ) and very, very carefully type CLASSPATH or whatever that is as the name and place the copied shortcut, minus a few characters:
Clipping back to the"... \Java" ( do not use my sample, find yours on your own machine )
..... place the copied shortcut, minus a few characters in the value area that the control gives you. Also, you may try pasting the shortcut that was copied directly in the work folder, sometimes this works. It is supposed to work but often is not picked up by the shell. Read also the other post cited that has the link, I will go read it if you want.
Win will fix nothing, that's how they make their money. You will find that Java will do much more that VB
Post back with a clear, detailed record of what you tried. Do you have an editor?
I have the same book. It's the best book on programming I have ever used. About your Class Path problem, see this thread. Mostly everyone, including me, struggled or struggles with class paths. We forget these things as the IDEs spoil us. ;)
Originally Posted by teamkeff
I hope this thread helps. Good luck teamkeff ;)
thanks Tim yes that worked, very grateful. thanks nicholas too, i am sure i will have more questions, i hope i don't have to go throught that hassle if i want to run a windows program, if infact it alows me to, but i won't get ahead of myself just yet.