Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
public:smartcard:javacardcompilation [2011-05-30 10:44] petrspublic:research:smartcard:javacardcompilation [2016-12-01 13:28] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== JavaCard applet development ======
 +~~NOTOC~~
 +<note tip>The description in section 'JavaCard applet development with NetBeans IDE' is outdated as we now have easier option.</note>
  
-====== JavaCard applet development with NetBeans IDE ====== +===== JavaCard applet development with AppletPlayground/GlobalPlatformPro/JCardSim and JCAlgTest =====
-(c) 2010 by LaBAK FI MUNI+
  
-{{:public:smartcard:scripttemplates.zip|Download script templates}} for common smart cards.+  * Use AppletPlayground for compilation and conversion into JavaCard applet (by Martin Paljak): https://github.com/martinpaljak/AppletPlayground 
 +  * Use GlobalPlatformPro for upload of converted applets onto real cards (by Martin Paljak): https://github.com/martinpaljak/GlobalPlatformPro 
 +  * Read slides with JavaCard development tutorial (by Petr Svenda): {{:public:research:smartcard:javacard_2016.pdf|javacard.pdf}} 
 +  * Use JCardSim simulator to develop even without real smart card: https://jcardsim.org 
 +  * Consult JCAlgTest project for properties (supported algorithms, performance) of real smart card if you plan to buy one: https://www.fi.muni.cz/~xsvenda/jcsupport.html 
 + 
 + 
 +---- 
 + 
 + 
 +===== (OUTDATED) JavaCard applet development with NetBeans IDE ===== 
 +(c) 2010-2011 by LaBAK FI MUNI (contact us at http://www.fi.muni.cz/research/laboratories/labak/
 + 
 +{{scripttemplates.zip|Download script templates}} for common smart cards.
  
 {{:public:smarthelloworld.zip|Download example project}} with standard Sun Java Card Hello World example with all configurations applied. {{:public:smarthelloworld.zip|Download example project}} with standard Sun Java Card Hello World example with all configurations applied.
 +
 +{{JavaCard_tutorial_2011.pdf | Download slides with JavaCard tutorial.}} To be used with Ubuntu VirtualBox image.
 +
 +[[https://www.youtube.com/watch?v=khgT5dwKvOo | Oracle JavaCard tutorial (2013)]]
  
 ===== Installation process ===== ===== Installation process =====
Line 24: Line 43:
   - Set configuration parameters in "nbproject/project.properties" (file in your project directory)    - Set configuration parameters in "nbproject/project.properties" (file in your project directory)
      * jc.home     - path to Java Card Development Kit      * jc.home     - path to Java Card Development Kit
-     * jc.export_files      - path to Java Card export files (for verifier), usually ${jc.home}\\api_export_files+     * jc.export_files      - path to Java Card export files (for verifier), usually ${jc.home}\\api_export_files  (NOTE: JC SDK 2.1.2 has this folder named api21_export_files)
      * gpshell.home     - path to GPShell       * gpshell.home     - path to GPShell 
      * gpshell.cmd     - path to GPShell executable      * gpshell.cmd     - path to GPShell executable
Line 213: Line 232:
   * When compilation is done (compiled files are in build/classes/), task "convert" is executed and performs conversion and verification. Converted file can be found in build\classes\com\sun\javacard\samples\HelloWorld\javacard. This action can be configured in task "convert" in build.xml.    * When compilation is done (compiled files are in build/classes/), task "convert" is executed and performs conversion and verification. Converted file can be found in build\classes\com\sun\javacard\samples\HelloWorld\javacard. This action can be configured in task "convert" in build.xml. 
   * Testing executes script "scripts/helloInstallGP211_JCOP41_cap.txt" in GPShell and tries to install HelloWorld on compatible Java Card. This action can be configured in task "run-script" in build.xml.    * Testing executes script "scripts/helloInstallGP211_JCOP41_cap.txt" in GPShell and tries to install HelloWorld on compatible Java Card. This action can be configured in task "run-script" in build.xml. 
 +
 +===== Troubleshooting ===== 
 +
 +  * Problem: Compilation fails with error: cannot find symbol XY (e.g., symbol: variable KeyAgreement)
 +    * Correct JavaCard SDK was not added to libraries.
 +    * If you get error for all JavaCard classes, then add library for your target card (e.g., 2.2.1)
 +    * if you get this error only for few classes (but not all), then you are using JC SDK without supprt for this classes (e.g., KeyAgreement, Checksum, MEMORY_TYPE_PERSISTENT... are not present in 2.1.2, but are present in 2.2.1)
 +
 +  * Problem: Convert fails with: Error: Could not find or load main class com.sun.javacard.converter.Converter
 +    * Compilation was successful, but Converter was not found. Check if your //jc.home// path is correctly set in nbproject\project.properties file. Note that you must use double \ in path (e.g., d:\\Apps\\JavaCardSDK2.2.2)