CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Nov 2010
    Posts
    81

    TextPad 5 can't find Java

    I have tried several times to find a solution by searching the internet... nothing. I installed Java JDK 1.6.0_23 THEN installed TextPad 5.4.2. I am running Windows 7. When I go to Tools > External Tools > Compile Java it gives me the message "javac.exe: The system cannot find the file specified." My class' professor had given us detailed instructions on how to install these programs... for XP using 5-version older programs. I did my best to install the same way, but some options have changed and the older versions don't work on Windows 7. Can anybody tell me how to fix this? Please?

    EDIT: I also added a system variable "JAVA_HOME" with the value C:\Program Files\Java\jdk1.6.0_23\bin ...someone said I needed to modify the CLASSPATH variable too, but what should the value be set to? And does my JAVA_HOME need the .; before the value?
    Last edited by LogicWavelength; February 13th, 2011 at 09:02 AM.

  2. #2
    Join Date
    Nov 2010
    Posts
    81

    Re: TextPad 5 can't find Java

    Please, somebody? I can't find help anywhere! I realize after even more reading that I need to change those system variables... but I don't know what I'm doing. Our book had told us to modify CLASSPATH when installing Tomcat... but my professor instructed us not to install it (but I already had) and now I don't remember what the CLASSPATH value was BEFORE I changed it... I really need to get this project submitted... my code is all written out I just can't compile it so I can submit a screenshot!

  3. #3
    Join Date
    May 2002
    Location
    Lindenhurst, NY
    Posts
    867

    Re: TextPad 5 can't find Java

    I don't use TextEdit, but it sounds like its expecting javac to be in the Windows Path. Try this:

    Start -> Computer -> System Properties -> Advanced System Settings -> Environment Variables...

    In 'System variables', edit the 'Path' variable. Add this to the end of the 'Variable value:'

    ;C:\Program Files\Java\jdk1.6.0_23\bin

    Don't erase whats already there, just add the above text to the end of it.

    Then restart TextEdit.

    Another alternative is to replace 'javac', wherever you entered it in TextEdit, with "C:\Program Files\Java\jdk1.6.0_23\bin\javac.exe". This is less convenient & may not always work, but you wouldn't need to alter the OS's Path variable.

    JAVA_HOME is used by some applications. Its not always necessary but shouldn't hurt having it. It should be set to 'C:\Program Files\Java\jdk1.6.0_23' (assuming thats where you installed it).

    CLASSPATH is generally best not used. Instead specify the classpath on the javac & java command line. But here we're getting back into this TextEdit 'conveniently run javac within a text editor' thing. I don't know how TextEdit handles that. I personally think you'd be better off compiling & running with the Windows command prompt (when just starting out), but if your teacher said use TextEdit then use that for the class assignments. Just to be more clear: you can actually compile & run java programs with just JDK, Notepad and Windows command prompt. I think the TextPad thing is just adding a few things: syntax coloring the java code & the ability to compile & run within the text editor. But none of this is needed to compile & run java code, they're just conveniences.

  4. #4
    Join Date
    May 2002
    Location
    Lindenhurst, NY
    Posts
    867

    Re: TextPad 5 can't find Java

    Oops, meant to say 'TextPad' not 'TextEdit'.

  5. #5
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: TextPad 5 can't find Java

    Did you read the TextPad help? It tells you how to set it up to use Java. You must install the JDK using the installer first.

    Select JAVA from the TextPad Help Index and follow the instructions.

    Here is a partial extract:
    1. From the Configure menu, choose Preferences.

    2. Select the Tools page on the Preferences dialog box.

    3. Click Add.

    4. Select "Java SDK Commands" from the drop down menu.

    5. Click OK.
    Computers are good at following instructions, but not at reading your mind...
    D. Knuth
    Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

  6. #6
    Join Date
    Nov 2010
    Posts
    81

    Re: TextPad 5 can't find Java

    Quote Originally Posted by dlorde View Post
    Did you read the TextPad help? It tells you how to set it up to use Java. You must install the JDK using the installer first.

    Select JAVA from the TextPad Help Index and follow the instructions.

    Here is a partial extract:


    Computers are good at following instructions, but not at reading your mind...
    D. Knuth
    Yes, I did install the JDK first and yes, my TextPad already has the Java tools in the Tools > External Tools drop-down. I am trying the solutions posted above, I'll update this reply if it's fixed. Thank you for responding.

  7. #7
    Join Date
    Nov 2010
    Posts
    81

    Re: TextPad 5 can't find Java

    Success!!!! However, I will say that my TextPad doesn't show color coding, its just all black text. This isn't a problem (especially considering what I just had to do to even get it to work) but it would be nice if it worked. Again, I don't need it as I understand what the code means, I just want it to look prettier... haha.

    Martin O, thanks for being the person who helped me considering the C++ thread I had.

  8. #8
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: TextPad 5 can't find Java

    Incidentally, why use TextPad when you could use a fully featured IDE like the IDEA Community Edition (open source, so free) ?

    The tools we use have a profound (and devious!) influence on our thinking habits, and, therefore, on our thinking abilities...
    E. Dijkstra
    Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

  9. #9
    Join Date
    May 2011
    Posts
    1

    Thumbs up Re: TextPad 5 can't find Java

    Quote Originally Posted by Martin O View Post
    I don't use TextEdit, but it sounds like its expecting javac to be in the Windows Path. Try this:

    Start -> Computer -> System Properties -> Advanced System Settings -> Environment Variables...

    In 'System variables', edit the 'Path' variable. Add this to the end of the 'Variable value:'

    ;C:\Program Files\Java\jdk1.6.0_23\bin

    Don't erase whats already there, just add the above text to the end of it.

    Then restart TextEdit.

    Another alternative is to replace 'javac', wherever you entered it in TextEdit, with "C:\Program Files\Java\jdk1.6.0_23\bin\javac.exe". This is less convenient & may not always work, but you wouldn't need to alter the OS's Path variable.

    JAVA_HOME is used by some applications. Its not always necessary but shouldn't hurt having it. It should be set to 'C:\Program Files\Java\jdk1.6.0_23' (assuming thats where you installed it).

    CLASSPATH is generally best not used. Instead specify the classpath on the javac & java command line. But here we're getting back into this TextEdit 'conveniently run javac within a text editor' thing. I don't know how TextEdit handles that. I personally think you'd be better off compiling & running with the Windows command prompt (when just starting out), but if your teacher said use TextEdit then use that for the class assignments. Just to be more clear: you can actually compile & run java programs with just JDK, Notepad and Windows command prompt. I think the TextPad thing is just adding a few things: syntax coloring the java code & the ability to compile & run within the text editor. But none of this is needed to compile & run java code, they're just conveniences.
    I am new to this site and am so glad I came across it. I am taking a Java Programming class at my community college this summer and was having the same problem Logic was. The first part of the above quoted worked perfectly for me. I just wanted to say thank you and I hope to be able to contribute in the future as my education and experience expands. Thanks again!!

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured