Batch file missing

Using the Java SDK with TextPad

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

Post Reply
Andrea

Batch file missing

Post by Andrea »

Quite often, I get a batch file missing error after executing a Java GUI application. In fact, a few of my coworkers also have encountered this error. Although it doesn't appear to affect our programs, we'd like to know why this occurs. Is a problem with Textpad? Thanks.
John

Re: Batch file missing

Post by John »

It is a problem with TextPad, in a sense. TextPad creates a temporary batch file each time you run Java. This temporary file has a limited liftetime (several minutes). If your program runs for longer than that lifetime, the batch file "dies," and so it is "missing" when your program finishes running. (After the program runs, you are returned to the batch file, usuially just to end it).
To solve the probelm, create your own batch file, say run.bat, with contents

@echo off
cd %1
java -cp .;C:\java %2
pause

Then replace the Run Java tool with a new tool, having command
C:\whateverdirectory\Run.bat
(whateverdirectory is the place where you put run.bat
parameters
$FilePath $BaseName
and initial folder
$FileDir
Post Reply