javaruntimes/standalone/tsrc/src/main.cpp
branchRCL_3
changeset 18 9ac0a0a7da70
parent 14 04becd199f91
equal deleted inserted replaced
17:0fd27995241b 18:9ac0a0a7da70
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  This main entry point of Java processes.
    14 * Description:
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include <string>
    18 #include <string>
    19 #include <javastarter.h>
    19 #include <javastarter.h>
       
    20 #include "logger.h"
    20 
    21 
       
    22 int main()
       
    23 {
       
    24     const char* const fileName = "c:\\java\\jvmargs.txt";
    21 
    25 
    22 int main(int argc, const char *argv[])
    26     int res = 0;
    23 {
    27     struct stat buf;
    24 #ifdef __WINS__
    28 
    25     const char* const fileName = "c:\\java\\JvmArgs.txt";
    29     if (stat(fileName, &buf) == 0)
    26 #else
    30     {
    27     const char* const fileName = "f:\\java\\JvmArgs.txt";
    31         PLOG(EJavaRuntime, "javatest: using arguments from file");
    28 #endif
    32         res = java::start(fileName);
    29     int res = java::start(fileName);
    33     }
       
    34     else
       
    35     {
       
    36         PLOG(EJavaRuntime, "javatest: using default arguments");
       
    37         const char* argv[] = { "-profile=standalonemidlet",
       
    38                                "-conf=cldc",
       
    39                                "-jar",
       
    40                                "c:\\java\\midlet.jar" };
       
    41         int argc = sizeof(argv) / sizeof(argv[0]);
       
    42         res = java::start(argc, argv);
       
    43     }
       
    44 
    30     return res;
    45     return res;
    31 }
    46 }