Results 1 to 7 of 7
  1. #1
    teamkeff is offline Member
    Join Date
    Jun 2008
    Posts
    3
    Rep Power
    0

    Default 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.

  2. #2
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default

    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?

  3. #3
    teamkeff is offline Member
    Join Date
    Jun 2008
    Posts
    3
    Rep Power
    0

    Default

    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

  4. #4
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    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....
    freedom exists in the world of ideas

  5. #5
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default 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:

    C:\Program Files\Java\jdk1.5.0_12\bin\javac.exe

    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?

  6. #6
    tim's Avatar
    tim
    tim is offline Senior Member
    Join Date
    Dec 2007
    Posts
    435
    Rep Power
    7

    Default

    Hello teamkeff

    Quote Originally Posted by teamkeff View Post
    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 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. ;)

    I hope this thread helps. Good luck teamkeff ;)
    Eyes dwelling into the past are blind to what lies in the future. Step carefully.

  7. #7
    teamkeff is offline Member
    Join Date
    Jun 2008
    Posts
    3
    Rep Power
    0

    Default

    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.

Similar Threads

  1. javac?
    By sardare in forum Eclipse
    Replies: 1
    Last Post: 06-14-2008, 02:06 AM
  2. source code of 'javac'?
    By Pooja Deshpande in forum Advanced Java
    Replies: 2
    Last Post: 06-04-2008, 11:24 AM
  3. cannot resolve symbol while using javac
    By andi9 in forum New To Java
    Replies: 5
    Last Post: 05-14-2008, 06:50 AM
  4. javac DOS
    By rdunne in forum New To Java
    Replies: 3
    Last Post: 01-01-2008, 11:49 AM
  5. Help with javaC
    By Daniel in forum New To Java
    Replies: 2
    Last Post: 07-04-2007, 02:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •