# Solved: Texpad and Java



## csatennis (Mar 3, 2007)

I am trying to compile a java program in textpad. Textpad is looking in c:\windows\system for the javac.exe file. I have that file in the c:\sun folder.

I am including screenshots to show you the problem. How can I get texpad to locate the javac.exe/


----------



## Chicon (Jul 29, 2004)

Hi csatennis,
Just try this (it works on my computer) :

- in _TextPad_, select _Configure_ > _Tools_ > _Compile Java_ :
in the _Initial Folder_ input box, type *$FileDir* then click _Apply_ and exit _TextPad_;

- on your desktop, right-click on the _My Computer_ icon and select _Properties_ in the context menu;
- select the _Advanced_ tab and click the _Environment Variables_ button;
- in the lower listbox border-titled _System Variables_, select the variable _Path_ and click _Edit_;
- at the end of the _Variable value_ input box of the _Edit System Variable_ pane, add *;C:\Sun\sdk\jdk\bin* then click _Ok_ many times you need to close all open panes.

Relaunch TextPad,
to compile your Java file : select _Tools_ > _External tools_ > _Compile Java_
to run your program : select _Tools_ > _External tools_ > _Run Java Application_


----------



## csatennis (Mar 3, 2007)

I still get the error shown in the 2nd jpg that says
C:\windows\system32\javac.exe

the system cannot find the file specified

ok


----------



## Chicon (Jul 29, 2004)

Ok, let's try this :
- launch _TextPad_, then select _Configure_ > _Preferences_ > _Tools_;
- click the _Add_ button and select _Program_ in the drop-down list; a window will open;
- below, near the _File name_ input box, click on the small black triangle in order to browse until you reach the file *C:\Sun\sdk\jdk\bin\javac.exe*, then click the _Open_ button;
- the window will close and you're back on the previous window, click _Apply_ to record the new entry called _Javac_

To compile your Java file, you've just have to select _Tools_ > _External tools_ > _Javac_.

If you've problem to run your program, you've just to proceed like before, you add a new entry and you browse until you reach the file *java.exe*.

You may edit again the environment variable _path_ to remove ONLY what I've told you to add in my prior post.


----------



## csatennis (Mar 3, 2007)

that did it! thank you very very much for your help


----------



## Chicon (Jul 29, 2004)

csatennis said:


> that did it! thank you very very much for your help


:up: You're welcome !


----------

