This discussion is archived
6 Replies Latest reply: Jun 7, 2012 11:22 PM by Sebastien_Lorquet RSS

I can't convert applet

897097 Newbie
Currently Being Moderated
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 Journeyer
    Currently Being Moderated
    Which tool you are using and how you are converting ?
  • 2. Re: I can't convert applet
    897097 Newbie
    Currently Being Moderated
    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 Journeyer
    Currently Being Moderated
    Use some tool to convert your src code into a .cap file.
  • 4. Re: I can't convert applet
    Sebastien_Lorquet Journeyer
    Currently Being Moderated
    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 Newbie
    Currently Being Moderated
    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 Journeyer
    Currently Being Moderated
    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

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points