6 Replies Latest reply: Jun 8, 2012 1:22 AM by Sebastien_Lorquet RSS

    I can't convert applet

    897097
      Hello there.

      I have a question.


      When I try to convert applet, error message pops up.

      "error: package visible interface com.nsicc.Constants, implemented by a public class com.nsicc.Nsicc contains fields."

      I use Java Card version 2.2.1.


      I'll wait your help.

      Thank you
        • 1. Re: I can't convert applet
          Umer
          Which tool you are using and how you are converting ?
          • 2. Re: I can't convert applet
            897097
            I used converter.exe in JC_HOME\bin.

            And I run it using command "converter.exe -config nsicc.opt" on console.
            • 3. Re: I can't convert applet
              Umer
              Use some tool to convert your src code into a .cap file.
              • 4. Re: I can't convert applet
                Sebastien_Lorquet
                the error is very clear

                error: package visible interface com.nsicc.Constants, implemented by a public class com.nsicc.Nsicc contains fields

                so you have somewhere
                package com.nsicc;
                interface Constants {
                    public static final short SOME_VALUE = (short)0x4242;
                }
                and somewhere else:
                package com.nsicc;
                public class Nsicc extends Applet implements Constants {
                //some code using SOME_VALUE
                }
                I don't know why, but the converter is not happy.

                here are 3 possible independent solutions

                1) try to make the interface public in a separate file

                2) try avoiding the implementation:
                package com.nsicc;
                public class Nsicc extends Applet {
                //some code using Constants.SOME_VALUE
                }
                3) use constants in your class and delete the interface
                package com.nsicc;
                public class Nsicc extends Applet {
                    public static final short SOME_VALUE = (short)0x4242;
                //some code using SOME_VALUE
                }
                that may please the converter better. No guarantee however, but that's how I understand the error.

                regards
                • 5. Re: I can't convert applet
                  897097
                  how did you see my code?

                  your sample codes nearly resemble my code.

                  I choose solution #1, and I solve it.

                  Thank you.
                  • 6. Re: I can't convert applet
                    Sebastien_Lorquet
                    read the error sentence carefully, everything is written down.

                    here it is again

                    error: package visible interface com.nsicc.Constants, implemented by a public class com.nsicc.Nsicc contains fields

                    regards