re: TextPad will compile but won't run

Using the Java SDK with TextPad

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

Post Reply
Jennifer Scotti

re: TextPad will compile but won't run

Post by Jennifer Scotti »

Help !!!!

I have taken a few java courses and have TextPad installed on my desktop and it works fine. I am also able to compile from the MSDS window as well.

Here's the problem. I just bought a new laptop to use for my classes as well. I installed the same sdk (sdk1.3.1_03) as my desktop and then installed TextPad.

With the help of my professor I got it to run and compile from the MSDS window, so I know the path and classpath are set correctly. But when I try it from the TextPad it will only compile and not run.

I get the lovely "NoClassDefFound" error. Now the program is just a Hello program, but it is in a package.

Here are my settings:

The paths in the autobat file are:

SET PATH=.;c:\jdk1.3.1_03\bin;
SET CLASSPATH=.;c:\JavaCode

note: JavaCode is where the package is

I am running windows 98 se on both systems

In TextPad --> Configure --> Preferences -->

Compile settings:
Command: javac.exe
Parameters: $File
Initial Folder: $FileDir

Run Settings:
Command: java.exe
Parameters: $BaseName
Initial Folder:$FileDir

Any ideas????

Jen
Andy Mitchell

re: TextPad will compile but won't run

Post by Andy Mitchell »

Jen,

Your runtime initial folder would need to be c:\ in this case - and in general it should be the directory under which your package structure exists.

Longer term, if you're developing multiple applications, you might get into trouble using the 'system' CLASSPATH as it will get cluttered up with entries which may not be relevant. It may be worth considering removing your autoexec.bat entries, reverting your standard Java run tool settings to the default (i.e. $FileDir in the initial folder) and creating a new Textpad tool (through Add->Program) with the settings set to something like (with some extra random jars added...) :-

Command: c:\jdk1.3.1_03\bin\java.exe
Parameters: -cp c:\;c:\myjars\abc.jar;.....c:\myjars\xyz.jar $BaseName
Initial folder: c:\

You can change this, or create others for different applications and your 'system' settings will remain unchanged.

Similarly, for compiling, you can set up a tool with settings like :-
Command: c:\jdk1.3.1_03\bin\javac.exe
Parameters: -deprecation -d c:\ -classpath c:\;c:\myjars\abc.jar $File
Initial folder: $FileDir

Hope this helps!
Andy.
Post Reply