Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



How to set the Java command line

For Java applications, you must provide arguments to pass to the Java VM in Java Command Line Text on the Application tab. It can contain any of the arguments that can be given to the pjava executable.

The Java code files (.class/.jar/.zip) can be located in any Emulator or target device directory, as long as the command line in refers to the correct location.

Note that when an application is invoked from a shell program, the current directory is set by default to the application directory (\system\apps\app_name\). This means that the application's .class files, and any other files associated with it (e.g. .html, .au or .gif), should also normally be installed in this directory or its subdirectories. They could be located elsewhere, but in this case, you would need to explicitly specify their location using the -cp argument in the command line.


A simple application

Assume that you have a simple application with one class file, HelloWorldApp.class, and that you have put it in a suitable application directory such as \System\Apps\HelloWorld. As the current directory defaults to the application directory, the command line simply needs to specify the name of the class file:

HelloWorldApp

[Top]


Application deployed in a .jar file

The next example assumes that the class files have been archived into a .jar file, HelloWorldApp.jar, and that this has been placed in the application directory \System\Apps\HelloWorld. The command line text sets the class path to include the .jar:

-cp \system\apps\HelloWorld\HelloWorldApp.jar HelloWorldApp