Step 1 installSDKPreparations:
1. InstallJdk-1_5_0_22-windows-i586-p.exe,:
Http://download.csdn.net/detail/sonylogin/3646422
To avoid errors, install the SDK directly in c: \ jdk1.5.0 _ 22.
2. InstallationEclipse.
3. Install the plug-inJcdk,:
Http://download.csdn.net/detail/hubi0952/3450766
(1). decompressCom. IBM. bluez. jcop. eclipse_3.1.1. BCopy a folderEclipseOfPluginsDirectory.
(2). If you startEclipseAfterCom. IBM. bluez. jcop. eclipse_3.1.1. BThe plug-in is not loaded. Please turn it offEclipse, EnterEclipseOfConfigurationDirectory, delete. SettingsFolder andConfig. iniRestart all files outside the configuration fileEclipseYou can.
(3).Cracking:
SetCom. IBM. bluez. jcop. Eclipse. prefsCopyEclipseWorking directoryWorkspaceUnder. Metadata \. plugins \ org. Eclipse. Core. runtime \. SettingsDirectory..
4.DownloadJava_card_kit-2_2_2-windows, web site:
Http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javame-419430.html#java_card_kit-2.2.2-oth-JPR
5. Environment configuration, my computer advanced, Environment configuration, create the following environment variables.
(1) java_home:
C: \ jdk1.5.0 _ 22
(2) jc_ant_task_home:
E: \ Android \ java_card_kit-2_2_2-windows \ java_card_kit-2_2_2 \ ant-tasks;
(3) jc_home:
E: \ Android \ javacard-cap \ java_card_kit-2_2_2
(4) classpath:
.; % Java_home % \ Lib \ DT. jar; % java_home % \ Lib \ tools. jar; % jc_ant_task_home % \ Lib \ jctasks. Jar
Reprint please indicate from: http://blog.csdn.net/menghnhhuan/article/details/7616690
Step 2 create a project:
1.InEclipseCreate a project on, selectJava Card Project.
2.Create on the project just createdJava card Applet, InputAid...Complete as prompted, Engineering example.
Step 3 compile the project generation. Class:
1.CreateCompile. bat, The content is as follows:
[HTML] View plaincopyprint?
- Rem Java source code
- SetJava_source_root=. \ SRC
- Rem compile all the files in the path of % java_source_root % \ Mifare \ example
- % Java_home % \ bin \ javac-g-source 1.3-target 1.1-classpath % jc_home % \ Lib \ API. Jar % java_source_root % \ Mifare \ example \ *. Java
- Pause
2.RunCompile. batGenerate. ClassFile, stored in% Java_source_root % \ Mifare \ exampleDirectory.
Step 4: generate. CapFile:
You have generated. ClassFile generated based on this file. CapFile
1.Create a fileHelloworld. Opt, The content is as follows:
[HTML] View plaincopyprint?
- -Out exp JCA cap
- -Exportpath E: \ Android \ javacard-cap \ java_card_kit-2_2_2 \ api_export_files
- -Classdir E: \ Android \ javacard-cap \ SRC
- -Applet 0xad: 0xad: 0xad: 0xad: 0xad: 0xad
- Mifare. example. mifareexample
- Mifare. Example
- 0xad: 0xad: 0xad: 0xad: 0xad: 0x01 1.0
Note:
E: \ Android \ javacard-cap \ java_card_kit-2_2_2 \ api_export_files:JckOfExpPath
E: \ Android \ javacard-cap \ SRC:. ClassPath
0xad: 0xad: 0xad: 0xad: 0xad:AppletOfAid
Mifare. example. mifareexample:AppletClass Name
Mifare. Example:AppletPackage name
(For details, referDocuments in jdk-1_5_0_22-windows-i586-p.exe .)
2.InDoSGoConverter. batDirectoryE: \ Android \ javacard-cap \ java_card_kit-2_2 _2 \ bin
RunHelloworld. Opt, Run the following command:Converter-config E: \ Android \ javacard-cap \ helloworld. Opt
Generated. CapPut files in. Class
Step 5EclipseDebugging
Right-clickApplet, SelectRun as/run ipvs, SelectMifareexample, Appears:
IfCard ReaderSelectJaca card simulation,Then selectPackage uploadTag, runRun, AppearsJcop ShellDebugging interface.