NEED HELP

Using the Java SDK with TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
jaynavs
Posts: 4
Joined: Fri Sep 22, 2006 12:54 am

NEED HELP

Post by jaynavs »

When I try to compile Java i get a message saying

C:\WINDOWS\system32\javac.exe
saying "The system cannot find the file specified".

When i run the program i get

c:\sun\appserver\jdk\bin is not recognized as an internal or external command

operable program or hatch file.

how do i fix this
User avatar
talleyrand
Posts: 624
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post by talleyrand »

Easiest solution would be to remove all the java tools and click Configure, Tools, Add new and select Java. Failing that, post back and I'm sure you can be walked through the process.

One fairly important thing however: please be certain that you have downloaded the Java SDK from java.sun.com. The JRE allows you to run programs but you will need the SDK to compile your programs.

Best of luck.
I choose to fight with a sack of angry cats.
jaynavs
Posts: 4
Joined: Fri Sep 22, 2006 12:54 am

Post by jaynavs »

ya lol how do you do this
jaynavs
Posts: 4
Joined: Fri Sep 22, 2006 12:54 am

Post by jaynavs »

i dont get it, how do i do this
User avatar
talleyrand
Posts: 624
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post by talleyrand »

Open Textpad
* Configure
* Preferences
* Tools
If it says Java, click the X button (del key) and whoosh it's removed.

Install the java SDK. If you cannot figure this out, take a moment and read the FAQs on http://java.sun.com

At this point you are now ready to add the java tools back to TextPad.

Open Textpad
* Configure
* Preferences
* Tools
* Add -> Java SDK Commands

Voila
I choose to fight with a sack of angry cats.
ikiwisi
Posts: 2
Joined: Fri Feb 16, 2007 8:07 pm

Post by ikiwisi »

well, I have the same kind of problem as jaynavs... I followed the instructions ... but...

XP Pro
jdk1.5.0_11
TextPad 4.7.3

compiling in a command window (cmd) = yes yes

compiling in TextPad = no no

help!
juhlster1021
Posts: 1
Joined: Mon Feb 19, 2007 8:12 pm

Post by juhlster1021 »

Hi, I have used TextPad as a Java editor at school and it is GREAT. So don't be discouraged.

Installing on my home machine, I just ran into the same roadblock as you two have. It took me some time to get it right, but I have to admit that in the end I got it going by rereading the TextPad FAQ > Java > FAQ no. 4

It seems that the version of the Java Development Kit that I used (1.5.0_11) does not set a registry key that TextPad is looking for. In my case I installed the jdk1.5.0_11 (with netbeans) executable right from Sun's website.

I did go into System Properties>Advanced>Environment Vars>System Vars and added this to the end of my Path variable (this may not match your path exactly because you have to use the path to the \bin file YOUR computer -- which may vary from mine):

Code: Select all

;C:\Program Files\Java\jdk1.5.0_11\bin  (including the semicolon at the start to separate it from the previous code)
So now I could compile java from any directory using the command line -- e.g.,

Code: Select all

c:\> javac Test.java 
and then

Code: Select all

c:\> java Test
... and it worked fine. But TextPad didn't care. When I tried to use Tools>Compile Java, I got a window something to the effect of:
(Title) "C:\Windows\system32\javac.exe" and (alert message) "The system cannot find the file specified."
So I ended up having to do what the FAQ suggested which was to open up regedit (Start>Run... and type in 'regedit' and OK) and navigate to

Code: Select all

HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Development Kit\CurrentVersion
The value in the current version entry was "1.5" so then I navigated to

Code: Select all

HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Development Kit\1.5\JavaHome
And I had to change the JavaHome variable from a value of "1" to the path to my JDK's main directory, which in my case is

Code: Select all

C:\Program Files\Java\jdk1.5.0_11
NOTE: The first time I did this I messed up and used the same string used to set the path. That didn't work, but when I took off the "\bin" at the end it was fine, which to my chagrin is exactly what the FAQ says that TextPad is looking for.....

Anyway, I hope that helps. Keep trying and don't let anyone discourage you for asking good questions.

Erik

P.S. ONE MORE THING: You always edit the registry at your own risk. It's almost never a smart thing to do unless you are a real geek. Which I am not, alas. So don't do anything except the above. And before you make any changes at all, you really, really should back up the registry -- in regedit, choose file>export and find a safe place to keep your exported registry file. Then you or your geeky friend may be able to fix anything you mess up. I named today';s backup file "20070219 about to change hlm-s-js-jdk-1.5 from 1 to a path.reg" so I can figure out what I was up to. And if Java starts acting flaky, you should consider returning the registry to its previous state, even if it means TextPad is not usable.
ikiwisi
Posts: 2
Joined: Fri Feb 16, 2007 8:07 pm

Post by ikiwisi »

Yes, it worked!

Thank you very much!
User avatar
Nicholas Jordan
Posts: 124
Joined: Mon Dec 20, 2004 12:33 am
Location: Central Texas ISO Latin-1
Contact:

Re: NEED HELP

Post by Nicholas Jordan »

jaynavs wrote: C:\WINDOWS\system32\javac.exe
saying "The system cannot find the file specified".
javac (dot exe) is not, or at least should not be in the windows system directory.

You can, just to fix what you have got [assuming your report is accurate] make a soft-link (shortcut in Win terminology) in the windows system directory that points to where javac acutally is, ... but that sort of defeats the purpose of posting - to find the answer to your question.

The correct way is to .......

Sorry, folks ....

Just give the entire path to the javac,.. yes no reg stuff for this level of question; I quit relying on the registry quite awhile back, be though it may I can install the %SystemRoot%\system32\charmap.exe by hand in the registry without getting out the licensed win disk and make file associations correctly [by hand in the registry] (if it doesn't use dde) but there is too much of windows that relies on the registry and you can inadvertenly waste your machine.
Post Reply