Problem in compiling j2me file

Hello friends,
friends my problem in compiling j2me file..
when i compile my j2me file through WTK2.2 (toolkit)
then it creates extra file including j2me" .class" file..
for example if my j2me file is "aman.java" and when i compile it
then it will covert into "aman.class" file but it creates one more file like "aman1$.class" ..plz help me to get out of this problem..coz its increase my j2me file size..
thanks
Aman

That is an inner class in aman.java that you are seeing there.
If you use inner anonymous classes, for example;
public class MyMIDlet extends MIDlet {
   // code for the MIDlet
   // Anonymous inner class
   setCommandListener(new CommandListener() {
      public void commandAction(Command c, Displayable d) {
        // implementation;
        // may access MyMIDlet's private fields
}then the command listener you create will become another class named MyMIDlet$1.class.
In this example you can get rid of the inner class by making one of the existing classes implement that CommandListener interface:
public class MyMIDlet extends MIDlet implmements CommandListener {
   public void commandAction(Command c, Displayable d) {
     // implementation;
     // may access MyMIDlet's private fields
   // code for the MIDlet
   // Instead of the anonymous inner class, we can now use MyMIDlet since it
   // implements CommandListener
   setCommandListener(this);
   // etc. etc. etc.
}shmoove

Similar Messages

  • Problem in Compiling Edited File

    Hello
    I am using Robo 8.0 for Word. My nightmare is that many times I get stuck after adding new topics or editing an existing topic with images and/or text. My files are big in size with many topics and a lot of images that are inserted as bmp. here is a snap shot of the problem that appears after compilation:
    In addition, I find the !SSI\webhelp folder empty after this error.
    I usually solve the problem by splitting the file into two, which is not always a good solution as I need it as one unit, or I start removing other topics or image and recompile again. This makes me think there is a size limitation!!
    Please explain the cause of the problem and suggest a solution.
    Regards

    Hi and welcome to the RH community.
    You don't say exactly what size the files you are working on are but the fact that things work when you remove content or split files would seem to indictae they are big.
    However I would say that if you are producing WebHelp output that you'd be better placed in using an editor and application better suited to HTML pages. Have you considered using the RH HTML application rather than RH for Word. If keeping the Word source is a must, you can use the Link to Word feature of this application which allows you to maintain the source in Word and link these to a RoboHelp project.
    Read the RoboColum(n) for a tips, tricks and musings on the Technical Communication Suite products.
    Follow the RoboColum(n) on Twitter

  • Problem while compiling 'dll' files in Form Server..Urgent

    Hi!
    I'm trying to compile the library(dll) in form server and getting a message that "can not open that file".At the same time able to compile 'fmb' files which is in the same directory.
    Could you please help me?
    Thank you,
    Denish

    I am also working on Forte. Forte has an inbuilt Tomcat. You dont need to copy any files to any where in the file mount system. You need to specify the External / Internal Browser settings, So that when you try to execute it, the .jsp file can be displayed in the browser. I havent faced any problem as you said.
    Uma
    http://www.javagalaxy.com

  • Problem in compiling jsp file

    Hi,
    i am using tomcat 4.12 and jdk 1.4.
    My login page contains 3 frames. after succesful login into ur application, 7 frames are getting called.
    i have called a jsp page for each frame.
    sometimes while accessing my application, i am getting jasper exception like cannot resolve symbol....
    for example
    D:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\sample\web\helpdesklogin_jsp.java:404: cannot resolve symbol
    symbol : method --ite  (java.lang.String)
    location: class javax.servlet.jsp.JspWriter
    out.write("<tr bgcolor=\"ffffff\">\r\n ");
    i do not understand the what is the problem here....
    likewise i am getting jasper exception. but it is not frequently occured in the frame.
    is there any relation with autoflush page directive attribute...?
    if it then should i increase default buffer size ?
    Reply please
    Thanks

    Your helpdesklogin.jsp file has a compilation error. It's hard to tell, but it looks like you mis-typed out.write() somewhere.
    - Saish

  • Problem to compile jar file

    Hi,
    I must to modify jar file umelogonbase.jar (in the package com.sapportal.runtime.logon)
    To do this I have created a java project with SAP NWDS.
    Then into this project, I have done an import of a zip file (umelogonbase.jar) to create a the same tree of directory than in the jar, to keep the .properties ...
    With DJ Java Decompiler I got the .java files. I put theses files at the same level then the .class (in the same folders). Then I removed the .class files.
    Finally I have added to the project the libraries needed (Properties/Java Build Path).
    When I do an export of the project to create a jar file, my jar file is created, but there are only the java sources files and not the class files. It seems that the project is not compilated.
    When I use the command Project/Rebuild Project, nothing happen.
    My goal is to create a JAR file with an identical architecture that the original. Just some classes will be modified. In this way I will can to replace the original jar file to the modified jar file.
    Can you tell me how to process.
    Regards
    Jean-Philippe Demoget

    Jean,
    I'm not sure what you menat by "..have created a java project with...", I done the same so I'll try to explain how:
    1. got the <b>com.sapportal.runtime.logon.par.bak</b> and renamed it to <b>.par</b>
    2. imported the par into NWDS (<i>File -> Import -> PAR file</i>) = created a project (with a new=custom name)
    3. got the <b>.JAR</b> files from the original <b>.PAR</b> and decompiled them somewhere
    4. renamed the <b>.JAD</b> to <b>.JAVA</b>, removed <b>.CLASS</b>
    5. moved the folder structure of decompiled <b>.JAVA</b> to <b>src.api</b> of the project structure
    6. refreshed the project and tried to rebuild (a lot of classpath issues)
    7. found the wanted <b>.JAR</b> files and added to the project as external libraries, so my final <b>.classpath</b> file looked like this (for EP6.0 SP2 - it can help you to find the right ones):
    <?xml version="1.0" encoding="UTF-8"?>
    <classpath>
        <classpathentry kind="src" path="src.api"/>
        <classpathentry kind="var" path="JRE_LIB" sourcepath="JRE_SRC"/>
        <classpathentry kind="src" path="src.core"/>
        <classpathentry kind="var" path="ECLIPSE_HOME/plugins/com.sap.developmentTools_1.2.0/prtapi.jar"/>
        <classpathentry kind="var" path="ECLIPSE_HOME/plugins/com.sap.developmentTools_1.2.0/soapapi.jar"/>
        <classpathentry kind="var" path="ECLIPSE_HOME/plugins/com.sap.developmentTools_1.2.0/inqmyxml.jar"/>
        <classpathentry kind="var" path="ECLIPSE_HOME/plugins/com.sap.developmentTools_1.2.0/inqmysoap.jar"/>
        <classpathentry kind="var" path="ECLIPSE_HOME/plugins/com.sap.developmentTools_1.2.0/prttest.jar"/>
        <classpathentry kind="var" path="ECLIPSE_HOME/plugins/com.sap.developmentTools_1.2.0/com.sap.security.api.jar"/>
        <classpathentry kind="lib" path="C:/Romano/Develop/java/ep 6.0/lib/com.sap.portal.themes.lafservice/lib/com.sap.portal.themes.lafserviceapi.jar"/>
        <classpathentry kind="lib" path="C:/Romano/Develop/java/ep 6.0/lib/servlet.jar"/>
        <classpathentry kind="lib" path="C:/Romano/Develop/java/ep 6.0/lib/com/sap/security/api/com.sap.security.core.jar"/>
        <classpathentry kind="lib" path="C:/Romano/Develop/java/ep 6.0/lib/jaas.jar"/>
        <classpathentry kind="lib" path="C:/Romano/Develop/java/ep 6.0/lib/prtcore.jar"/>
        <classpathentry kind="output" path="classes.api"/>
    </classpath>
    8. rebuilt the projet succesfully
    9. deployed
    This should work for sure.
    Hope this helps,
    Romano

  • Problem in compiling C file with JNI

    Hello to all,
    I have a simple JNI tutorial
    But after creating the header file using "javah -jni " command when I use that header file in to the C implementation it gives error
    Following code is of HelloWorld.cpp in which the header file in included
    #include <stdio.h>
    #include "HelloWorld.h"
    JNIEXPORT void JNICALL Java_HelloWorld_print(JNIEnv *env, jobject obj)
         printf("Hello World!\n");
         return;
    }The error is
    line number 2 - Unable to open include file "HELLOWORLD.H"
    line number 4 - Declaration syntax errorMy java file "HelloWorld.java" is
    class HelloWorld
         private native void print();
         public static void main(String[] args)
              new HelloWorld().print();
         static
              System.loadLibrary("HelloWorld");
    }I also after coping the file into the include directory of the TurboC but same error arise.
    Please suggest me what to do.
    Thanks in advance

    Yes I used "javah -jni HelloWorld" command after complying the program.
    It produced a header file which I have placed in the same directory in which my project is. Then the same error comes, when I place it in include directory of TurboC give same error.

  • Problems with compiling on files in Xcode

    Hello all I am following Buckys video tutorial on C++ of Placing Classes in Separate Files of tutorial 15
    at link
    ttp://www.youtube.com/watch?v=NTip15BHV ... ure=relmfu
    Right now I put up the 3 files.
    the
    main.cpp
    i used test as a file
    so i used
    test.cpp
    and final one is
    test.h
    I try to run the program I use Xcode and i get an error. However nothing comes up on screen to indicate where the error is.
    Anyone help me out.
    I will put my code on the screen here
    here is the main.cpp file
    Code:
    //  main.cpp
    //  test1
    //  Created by  on 11-11-25.
    //  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
    // introduction to classes and objects 12
    #include <iostream>
    #include "test.h"
    using namespace std;
    int main ()
        test bo;
        return 0;
    Here is the test.cpp file
    Code:
    //  test.cpp
    //  test1
    //  Created by on 11-11-25.
    //  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
    #include "test.h"
    #include <iostream>
    using namespace std;
    test::test()        // this says function is member of same class
       cout << " i like apples " << endl;
        //test
    and finally
    here is the test.h
    file
    Code:
    //  test.h
    //  test1
    //  Created by on 11-11-25.
    //  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
    #ifndef test_h
    #define test_h
    class test
    public:
        test();
    #endif // test_h
    Now i have tried to run on all 3 screens and still get error message.
    the error message i get in Xcode is this
    Quote:
    Command /Developer/usr/bin/clang++ failed with exit code 1
    So I am confused to what I am doing wrong. as i followed the tutorial to the T
    What suggestions can you all make?
    thanks and i await your replies.
    I use Xcode 4.2

    Hello there. I have #endif
    at the end of the file test.h already
    such as shown
    //  test.h
    //  test1
    //  Created by on 11-11-25.
    //  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
    #ifndef test_h
    #define test_h
    class test
    public:
        test();
      #endif 
    But i am still getting error message.
    #endif then?
    in which of the 3 screens?
    this is the error message i am getting
    ld: duplicate symbol _main in /Users/johnrescigno/Library/Developer/Xcode/DerivedData/test1-bradcvwlcmjrofelx zwsiwcvzacb/Build/Intermediates/test1.build/Debug/test1.build/Objects-normal/x86 _64/main-AA1A780F8E3AF22A.o and /Users/joh/Library/Developer/Xcode/DerivedData/test1-bradcvwlcmjrofelxzwsiwcvza cb/Build/Intermediates/test1.build/Debug/test1.build/Objects-normal/x86_64/main- AA1A780F8E3AF22A.o for architecture x86_64
    So i am still confused.
    thanks for your help so far?
    otherwise would this work different if i ran it in command line?
    i have not used command line in a long time
    can u tell me what to write in command line to access the file folder and run again?
    thanks

  • Problem compiling source file in package

    Hi, I have 5 source files which I have just packaged together and put in the same sub-directory, the problem is that when I try to compile the file with the main method I get the error message:"cannot read" then the name of the source file. I am compiling from the command line and setting the classpath as I compile with the statement:
    c:\j2sdk1.4.1\bin>javac -classpath c:\directory\package directory source file.java
    I'm not sure what I am doing wrong and the source files all compiled fine before I added the package statement to the files. Please any help would really be appreciated.

    It sounds like the java file your are trying to compile is not in the directory you are compiling from.
    Is this basically what you are doing?:
    Say the package name is mypackage.
    Assume we are O.K. with keeping source and class files together.
    Create a directory named 'mypackage' somewhere...C:\mypackage\.
    Put all the .java files in it (these .java files indicate that they are a member of the 'mypackage' package).
    At a command prompt, cd to the directory containing the 'mypackage' directory...'cd C:\'
    Compile the source files: C:\j2sdk1.4.1\bin\javac mypackage\*.java
    run the main class: C:\j2sdk1.4.1\bin\java mypackage.TheMainClass
    Basically, this says keep the files where you want them and point to javac, instead of moving everything under java/bin. btw it will save a lot of typing if you add java/bin to your PATH.
    Hope this helps.

  • JDev 9.0.3 - problem with compiler options to copy resource file types

    Hello,
    Following a quite strange scenario, I found something bizarre related to the project compile options in 9.0.3 production (I assume the same problem was present way before...)
    Let me first present the facts:
    Assume I have in my project one file named noext (with no extension!) and another one file.verylongext. I know it's not best practice, but let's say they are third party files and I would prefer not to touch them.
    I am able to add them to the project sources, in the specified packages, then I update the Project Settings/Compiler/Resource File Types to Copy to Output Directory.
    But, when I compile, I realize that not all my files were copied to classes/. In fact, if I specify ...;noext;file.verylongext, I get only noext copied, while if I specify ...;file.verylongext;noext, I only get file.verylongext.
    I also tried to use only .verylongext, but the result was exactly the same...
    Of course I can copy the files manually, outside JDev, but this is not best practice neither... :)
    As long as JDev 9.0.3 seems to provide support for filtering the files that will be added to a project (see thread Re: update column for details), I don't really see the purpose of filtering again the files that will be transferred to classes/ (apart from the little bug).
    I think it would be far more useful to have the reverse filter, i.e. "Resource File Types not to Copy to Output Directory". JDev team, would it be possible to have this in 9.0.4?
    Thanks,
    Adrian

    >I tried to reproduce the problem and couldn't.
    Nevermind, I will be back on this when I'll have a simple example.
    >One question, is noext and file.verylongext part of your project?
    Well, you know, since I said I have them in my project, it means that I added them there and I checked that they really were added. No offense...
    >One more question, did you enable Scan Source Path to ... in the input paths panel of the pproject properties?
    No, I did not enable this option, since I see all my files in the project and the only source path is project's src.
    But my real point is related to the enhancement request I made. Given the circumstances,
    could you provide the reverse filter, i.e. "Resource File Types not to Copy to Output Directory", in a future version, maybe 9.0.4?
    Thanks,
    Adrian

  • Hello...i have a problem with xcode...i am  a beginner user on mac and i am learning to program in C but lastime when i tried to compil a file with xcode it doens't function at well and i dont know while...her is my code source if somebody can help me

    #include <stdio.h>
    #include <stdlib.h>
    #define N 20
    int main (int argc, const char * argv[])
    {  FILE *fp;
        char nome_file[N];
        int i,j;
        int dim;
        float mat_in[N][N];
        float mat_out[N][N];
            // apertura del file
        printf("nome_file:");
        scanf("%s",nome_file);
        fp=fopen(nome_file, "r");
        if (fp==NULL) {
            printf("errore nell'apertura del file %s\n",nome_file, );
            return -1;
        fscanf(fp, "%d",&dim);
        printf("%d\n",dim);
        for (i=0; i<dim; i++) {
            for (j=0; j<dim; j++) {
                fscanf(fp, "%f",&mat_in[i][j]);
                printf("%.2f",mat_in[i][j]);
        int ordine_grandezza=1;
        for (i=0; i<dim; i++) {
            for (j=0; j<dim; j++) {

    here is my complete code source:
    #include <stdio.h>
    #include <stdlib.h>
    #include <errno.h>
    #define N 20
    int main (int argc, const char * argv[])
    {  FILE *fp;
        char nome_file[N];
        int i,j;
        int dim;
        float mat_in[N][N];
        float mat_out[N][N];
            // apertura del file
        printf("nome_file:");
        scanf("%s",nome_file);
        fp=fopen(nome_file, "r");
        if (fp==NULL) {
            printf("errore nell'apertura del file %s\nnumero errore: %d",nome_file, errno);
            return -1;
        fscanf(fp, "%d",&dim);
        printf("%d\n",dim);
        for (i=0; i<dim; i++) {
            for (j=0; j<dim; j++) {
                fscanf(fp, "%f",&mat_in[i][j]);
                printf("%.2f",mat_in[i][j]);
        int ordine_grandezza=1;
        for (i=0; i<dim; i++) {
            for (j=0; j<dim; j++) {
                if (mat_in[i][j]<=0){
                    mat_out[i][j]=0;
                else {
                    while (mat_in[i][j]>ordine_grandezza) {
                        ordine_grandezza=ordine_grandezza*10;
                    mat_out[i][j]=ordine_grandezza;
        for (i=0; i<dim; i++) {
            for (j=0; j<dim; j++){
                printf("%8.2f",mat_out[i][j]);
            printf("\n");
        int simmetric=0;
        for (i=0; i<dim && simmetric!=1; i++) {
            for (j=i+1; j<dim && simmetric!=1; j++){
                if (mat_out[i][j]!=mat_out[j][i])
                    simmetric=1;
        if (simmetric==1)
            printf("matrice simmetrica\n");
        else
            printf("matrice non simmetrica\n");
        return 0;
    and when i compil it shows it:
    nome_file:martin.txt
    errore nell'apertura del file martin.txt
    excuz me if i dont speak english very well....but i think that the problem is that i don't know to compil a file on xcode...and if yo can send me a tutorial about it i will be grateful

  • Problem compiling idl files

    I compiled several rmi-iiop examples from Weblogic 6.0 distribution (smaples\examples\rmi_iiop\ejb). Then I ran idlj on generated idl files and then javac to compile java files (both idlj and javac are part of Weblogic 6.0 distribution).In all cases compiler complained about generated javax.ejb.CreateEx, javax.ejb.RemoveEx and javax.io.IOEx that they didn't have all methods implemented (like toString(), message(), localizedMessage() and so on).Could anybody tell me if he or she managed to create working CORBA client using JDK 1.3 ORB and _EJB server object__?Thank you,Yuri

    Hello Eduardo,
    Thank you very much for your reply! This is a very good suggestion and I
    will try to use it!
    However, I would like to mention that it is possible to start with simple
    RMI model (using only primitive java types) and run weblogic.rmic on RMI
    class to generate IDL files. I tested RMI-IIOP examples that come with WLS
    5.1 and WLS 6.0 using Java 1.3 ORB and they worked in both cases.
    Thank once again for suggestion!
    Yuri
    "Eduardo Ceballos" <[email protected]> wrote in message
    news:[email protected]..
    A Java (JDK 1.3 ORB) client is not possible because the Java to IDLmapping creates conflicts with existing classes, in this case
    java.lang.Throwable. The problem is that you can not start with an RMI
    interface (the EJB in this case) and there after use the CORBA programming
    model. If you want to use the CORBA programming model, you must derive your
    java classes from the IDL to Java mapping.
    >
    Yuri Rychikhin wrote:
    I compiled several rmi-iiop examples from Weblogic 6.0 distribution
    (smaples\examples\rmi_iiop\ejb). Then I ran idlj on generated idl files and
    then javac to compile java files (both idlj and javac are part of Weblogic
    6.0 distribution).In all cases compiler complained about generated
    javax.ejb.CreateEx, javax.ejb.RemoveEx and javax.io.IOEx that they didn't
    have all methods implemented (like _toString(), message(),
    localizedMessage() and so on).Could anybody tell me if he or she managed to
    create working CORBA client using JDK 1.3 ORB and __EJB server
    object__?Thank you,Yuri
    >

  • Problem compiling java file to access web service! newbie troubles !

    I am new to web services and this is my first program...
    I am compiling java file which has import statement like:
    import org.apache.soap.util.xml.*;
    import org.apache.soap.*;
    import org.apache.soap.rpc.*;
    It says ----- package org.apache.soap.util.xml does not exist as one of errors..
    I have a folder that I named soap myself and I have activation.jar,serces.jar,mail.jar,soap.jar in it.
    I added c:\soap in my classpath and this was supposed to be the quickstart way to try an example out...
    but it gives me compilation errors... what should I do ?

    You'll need to specify each jar file in the classpath. c:\soap\xerces.jar;c:\soap\sax.jar;....

  • Problem compiling a  file which utilises a class I've created

    I am experimenting with creating my own classes. I've created my own class and I'm able to compile it. When I try to compile my test file to test the class I get a "cannot resolve symbol" error referring to where my class name is in the test file. The thing is, I've emailed the files to a friend and he is able to compile both files and subsequently run the test file. Has anyone got any ideas as to why my friend can compile the test file but I cannot?

    My XP machine is at home, so I cannot verify that. But for W2K, you can right-click on the My Computer icon, select Property. Then select Advanced tab. In the middle is Environment Variables. Click on the button to open up the User Variables and System variables. CLASSPATH is in the System Variables pane.
    XP should be similar to W2K. Give it a try.
    Hope this helps.

  • Problems with Compiled files when Adobe Jetforms are used

    Hi,
    I am taking outputs of Customer Facing Documents from SAP R/3 using Jetform Output Designer Version 5.4.0.130.
    The printer I am using is HP LaserJet 5100 Series. From the information I gathered this uses PCL 6. Therefore I compiled the file with the presentment target HP Laserjet 5000/5000N(PCL6)-[hp5000x]. When I use the PDF viewer as the default it gives me perfect alignment of the various fields. However when I take a printout everything is disturbed.
    Can you please suggest, what is the best approach to take.
    Thanks in advance.
    Regards,
    Paul

    There is a difference in resolution between PDF print and PCL print. E.g. PDF is default 1000 dpi, which is fine for screen view, yet most printers are 300 dpi or 600 dpi.
    If you make a copy of the PDF.ICS to apv_PDF.ICS. You can change the resolution by opening the file with a text editor like Notepad. Set the value to match your printer. Choose your custom PDF printer driver in Output Designer and recompile the form.
    You'll find it in the \Config directory where your designer is installed. ..\JetForm\Output Designer\Config

  • Problem in making "jar" file

    Hi ,
    I have to compile , preverify and make jar file using a set of J2ME files.
    And i have completed the first 2 steps (compiling and preverifying).
    I used this code to make jar file:
    jar cvfm F:\Mobile_Magazine_IDE\xxx_test3\Magazine.jar F:\Mobile_Magazine_IDE\xxx_test3\src\MANIFEST.MF  -C  F:\Mobile_Magazine_IDE\xxx_test3\preveryclasses\  . -C F:\Mobile_Magazine_IDE\xxx_test3\src\images\  .
      boolean compile_n_print_output_to_console(String command){
        boolean isCompiled = false;
        try {
          txa_console_output.setText("");
          Runtime runtime = Runtime.getRuntime();
          Process proc = runtime.exec(command);
          InputStream stderr = proc.getErrorStream();
          InputStreamReader isr = new InputStreamReader(stderr);
          BufferedReader br = new BufferedReader(isr);
          String line = null;
          while ( (line = br.readLine()) != null)
            txa_console_output.append(line + new_line);
          int exitVal = proc.waitFor();
          //If this returns any value other than zero ... compilation failed
          if(exitVal!=0){
            call_error_message("Compilation failed ");
          //If this returns zero ... compilation is successful
          else if(exitVal==0){
            isCompiled = true;
            call_info_message("Build successful !");
        catch (Exception ex) {
          isCompiled = false;
          System.out.println(ex);
          com.zone.logger.LoggerClass.log_output(ex);
        return isCompiled;
      }The program is generating the jar file but it does not return a boolean value.
    I think it's because it has not completed the process.
    But no exception is shown.
    I used the same code to compile and preverify , and they work fine.
    And one more thing when i use the same source code and compile those using well known IDE it compiles and works without a problem.
    Can anyone tell me where i have done the mistake ?
    Thanks in advance !

    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

Maybe you are looking for