Run Java Applet Sample Batch File for FTP/400 Remote Comand Server - Support

Run Java Applet Sample Batch File for FTP/400 Remote Comand Server

From Support

Jump to: navigation, search
If you have a question or seek clarification, please call Technical Support.

Problem:

Run Java Applet Sample Batch File for FTP/400 Remote Comand Server

Customer cannot run a Java Applet using the following command line from the FTP/400 Remote Command Server:

c:\java\bin\appletviewer  
c:\java\demo\Animator\appletviewer\example4.html

Solution:

A Java applet requires the Windows user to be in the same directory as the applet before the applet will run with the Java Applet Viewer when running the applet from a command line call. In order to run a Java Applet from a command line, whether in MS Windows or using the FTP/400 Remote Command Server, the following steps must be taken:

1.) Create a PC batch file named RUNAPPL.BAT in the C:\JAVA\BIN directory and copy the following commands into the .BAT file:

@REM - Run Selected Java Applet from Command Line
@REM - Parm 1 - Applet Viewer Program
@REM - Parm 2 - Drive Letter 
@REM - Parm 3 - Directory for Applet on Drive Letter
@REM - Parm 4 - Applet HTML Launch Page 
@REM Change to Drive
%2
@REM Change to Directory
CD %3
@REM Launch Applet
%1 %4
@ECHO Applet has completed.
@PAUSE 

2.) Make sure the C:\JAVA\BIN directory is in the PC search path.

3.) To run the same applet command as above, use the following command line with the FTPRUNPC AS/400 command:

FTPRUNPC CMD('c:\java\bin\runappl.bat c:\java\bin\appletviewer  c: \java\demo\Animator\  example4.html') OPTION(*SHELL)

4.) If all works well, you can remove the @PAUSE statement from RUNAPPL.BAT to keep the .BAT file from pausing.

Personal tools