Classpath w/ Textpad

Using the Java SDK with TextPad

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

Post Reply
tgc

Classpath w/ Textpad

Post by tgc »

After setting the classpath in a command window, I can compile my .java application. When attempting to compile the same file in TextPad I get errors that are obviously related to an unset classpath. Does anyone know how to point TextPad to the right/latest classpath?
Andreas

Re: Classpath w/ Textpad

Post by Andreas »

Set your classpath systemwide.

Control Panel -> System, last tab page, Button Environment..., then set or create a variable CLASSPATH with whatever your classpath is (including the swing jar!).

It might be necessary to boot the system to activate the environment variable, but afterwards each program gets the CLASSPATH
Jason Brown

Re: Classpath w/ Textpad

Post by Jason Brown »

ok... i've got Win XP.... i'm trying to get Java to compile. i get this---> " Cannot find File 'system32/javac.exe' "

i this something i need to do with Classpath?? what is the Value i need to put in there???

Thanks,
Henrik Skafsgaard Larsen

Re: Classpath w/ Textpad

Post by Henrik Skafsgaard Larsen »

Jason,

no. Classpath is used by java to find classes and jar files.
You need to set your PATH to the directory where javac.exe is located.
Just follow the directions Andreas gave for setting the CLASSPATH and
substitute CLASSPATH with PATH.

mvh / regards
Henrik Skafsgaard Larsen
john c

Re: Classpath w/ Textpad

Post by john c »

to be honest I think the latest version of textpad is fu***d up. i'M GETTING THE SAME PROBLEMS AND IT'S GOT NOTHING TO DO WITH SETTING THE CLASS PATH. WHEN YOU USE TEXTPAD TO OPEN A JAVA FILE AND THE COMPILE THAT FILE IT WILL SAVE THE CLASS FILE TO THE ORIGINAL DIRECTORY. I'VE BEING TRYING TO GET THIS CRAP WORKING FOR 3 DAYS!!!
Mark Schnitzius

Re: Classpath w/ Textpad

Post by Mark Schnitzius »

Are you setting the javac -D command line option when you compile?
Let's see the full set of parameters you are using to compile.
Dave Robinsn

Re: Classpath w/ Textpad

Post by Dave Robinsn »

Try using the Ant build tool from Apache at:
http://jakarta.apache.org/builds/jakart ... 1.4.1/bin/
You invoke Ant with an ant.bat file that can include your classpath and compilation target directories. The ant.bat file can be configured as a "DOS Command..." tool in TextPad and it can "prompt for parameters". This compilation approach has been working flawlessly for me.
Ben Munoz

Re: Classpath w/ Textpad

Post by Ben Munoz »

I use this technique (Textpad plus Ant) also and it works great.

Some hints: make sure you can get Ant to build your project without Textpad first. Use the command line ant.bat with a valid build.xml. http://jakarta.apache.org/ant for more information.

Once you have this working, Configure->Preferences->Tools->Add->Dos Command. Enter runant.pl, runant.py, or ant.bat.

Then, Configure->Preferences->Tools->ant.bat.

Uncheck capture output so you get a viewable Dos window.
Check prompt for parameters, so you can modify command line options.
Uncheck close DOS window on exit so you can see any compile errors.

More Ant articles are available here: http://jakarta.apache.org/ant/resources.html

Good luck,
Ben
Mari

Re: Classpath w/ Textpad

Post by Mari »

I am trying to add the keyboard class and I have to set it with -classpath but I cant get it to work. Does anyone know how.
Post Reply