Symbian
Symbian OS Library

FAQ-0246 Can I specify command-line options for a Java app at run time on a Symbian device?

[Index][spacer] [Previous] [Next]



 

Classification: Java Category: Runtime Control
Created: 07/05/99 Modified: 06/22/2001
Number: FAQ-0246
Platform: ER5

Question:
The ER5 SDK for Java explains how to launch a Java app from a DOS command line. But can I provide command-line options for a Java app in a similar way on a Symbian device?

Answer:
You can make use of a utility called E_SHELL which provides a DOS-like command-line environment on a Symbian device. This is distributed with ER5 C++ SDKs as \epoc32\release\marm\rel\eshell.exe and is also downloadable from the Symbian Developer Network Web site. You can copy it over to any folder on an ER5 Symbian machine and launch it by clicking twice.
The command syntax for launching Java apps is similar to that described for the emulator. For example, to launch PowerInfo.class located in C:\examples\powerinfo\, you would type:

>java -cd c:\examples\powerinfo PowerInfo

Note: you don't need to qualify the java command as it should already be on the system path. But the system will by default look for PowerInfo.class in the folder where it finds java.exe, so you do need manually to reset the current directory with the -cd switch.

The appletviewer too can be launched in a similar manner to the emulator version: to launch an applet in a file called index.html in folder c:\examples\myapplet\, you would type:

>appletviewer file:///c:/examples/myapplet/index.html