EclipseJCDE User Guide.docx
《EclipseJCDE User Guide.docx》由会员分享,可在线阅读,更多相关《EclipseJCDE User Guide.docx(16页珍藏版)》请在冰豆网上搜索。
EclipseJCDEUserGuide
EclipseJCDE
LastUpdated:
02-Mar-2008
TableofContents
Description
Installationsteps
UserGuide
Description
TheaimofEclipseJCDEprojectistoprovideasetofeclipsepluginsthatwrapstheJavaCardDevelopmentKittoolsandlibrariesprovidedbySunMicrosystemstoprovideavisualdevelopmentenvironmentthatautomatesmanyoftherequiredstepstodevelopaJavaCardapplication.
AteaminOrangeLabs/R&D(FranceTelecom)hasdevelopedextensionstotheprojectandcreatedanewprojectpartiallybasedonitsSourcecode()
Installationsteps
1.DownloadtheJavaCardDevelopmentKitv2.2.2fromandextractitscontentsto“java-card-dev-kit-root”,where“java-card-dev-kit-root”isthepathwhereyouextractedthecontentsofthedevelopmentkit.Forexample,“C:
\java_card_kit-2_2_2-windows”.
2.Extractthecontentsof“java-card-dev-kit-root/java_card_kit-2_2_2/java_card_kit-2_2_2-rr-bin-windows-do.zip”to“java-card-dev-kit-home”,where“java-card-dev-kit-home”isthepathwhereyouextractedthecontentsofthezipfile.Forexample,“C:
\java_card_kit-2_2_2-windows\java_card_kit-2_2_2”
3.Downloadeclipse3.2fromhttp:
//www.eclipse.org/downloads/andextractitscontentsto“eclipse-root”,where“eclipse-root”isthepathwhereyouextractedeclipse’scontents.Forexample,“C:
\eclipse”.
4.DownloadEclipseJCDEfromandextractitscontentsto“eclipse-root”.
5.Starteclipse.
6.Fromthemenubargoto“JavaCard”=>“Preferences”.
7.Click“Browse”andpointtothe“java-card-dev-kit-home”location.
UserGuide
Pleaseusethefollowinglink(http:
//eclipse-
EclipseJCDEUserGuide
LastUpdated:
20-Jun-2007
TableofContents
Description.1
Wizards.1
Tools.5
Simulators.9
Validations.11
Description
EclipseisanextensibleIntegratedDevelopmentEnvironment(IDE)thatallowsdeveloperstoextenditsfunctionalitiestocreatenewdevelopmentenvironments,customizedfortheirspecialneeds.EclipseJavaCardDevelopmentEnvironment(EclipseJCDE)makesuseofthisfeaturebyextendingEclipsetocreateavisualdevelopmentenvironmentforJavaCardapplications.
SunMicrosystemsprovidesaJavaCardDevelopmentKitalongwithasetofcommandlinetoolstohelpdevelopersdevelopJavaCardapplications.ThestepsofcreatingaJavaCardapplicationusingcommandlinetoolsaremanyandvulnerabletomanyhumanerrors.
EclipseJCDEusesEclipseplatformtowraptheJavaCardDevelopmentKittoolsandlibrariesprovidedbySunMicrosystemstoprovideavisualdevelopmentenvironmentthatautomatesmanyoftherequiredstepstodevelopaJavaCardapplication.
EclipseJCDEprovidesthefollowingfeatures:
-
Wizards
EclipseJCDEextendsthewizardsfunctionalityofEclipsetoprovideasetofwizardstoautomatethesetupprocessoftheenvironmentofaJavaCardApplication.Figure1showstheavailablewizardsforaJavaCardapplication.
“JavaCardProject”wizardisusedtoautomatethecreationprocessofaJavaCardProjectwithalltherequiredlibrariesinitsenvironment(classpath).Figure2showsascreenshotforthe“JavaCardProject”wizardandFigure3showsascreenshotforacreatedJavaCardproject.
Figure1:
EclipseJCDEwizards
Figure2:
The“JavaCardProject”wizard
Figure3:
AcreatedJavaCardProject
“JavaCardApplet”wizardisusedtoautomatethecreationprocessofaJavaCardApplet,andtoallowthejavacarddevelopertoentertheapplet’sAIDtobestoredintheproject’sworkspace.TheAIDisrequiredforgeneratingCAPfilesandAPDUscripts,andforinstallingtheappletonasimulatorfortesting.
ThenextstepofthewizardallowsaddingextrafeaturestothenewlycreatedJavaCardapplet.ItallowsaddingsupportforJavaCardRMI(RemoteMethodInvocation)andforShareableInterfaces,anditallowsoptionalgenerationofsamplecodeforbothfeaturesaswell.Figure4showsascreenshotforthe“JavaCardApplet”wizard,andFigure5showsascreenshotfortheextrafeaturesthatcouldbeaddedtoaJavaCardapplet.
Figure4:
The“JavaCardApplet”wizard
Figure5:
JavaCardapplet“ExtraFeatures”
Tools
EclipseJCDEprovidesasetoftoolstoaidinthedevelopmentofaJavaCardapplication.SomeofthesetoolswrapthecommandlinetoolsprovidedbySunMicrosystemsandautomatethepreparationoftheirargumentsbasedonthesetupoftheworkspaceoftheJavaCardproject.
“SetPackageAID”isatooltoallowsettingtheAIDofaselectedpackage.TheAIDshouldbeusedlateronwhilegeneratingCAPfilesandAPDUscriptsandwhileinstallingthepackageonasimulator.Figure6showsthepopupmenuthatappearsafterrightclickingapackage,andFigure7showsthedialogthatappearsafterselectingthe“SetPackageAID”menuitem.
Figure6:
SetPackageAIDpopupmenuitem
Figure7:
SetPackageAIDdialog
“SetAppletAID”isatooltoallowsettingtheAIDofaselectedJavaCardapplet.TheAIDshouldbeusedlateronwhilegeneratingCAPfilesandAPDUscriptsandwhileinstallingtheappletonasimulator.Figure8showsthepopupmenuthatappearsafterrightclickingaJavaCardapplet,andFigure9showsthedialogthatappearsafterselectingthe“SetAppletAID”menuitem.
Figure8:
SetAppletAIDpopupmenuitem
Figure9:
SetAppletAIDdialog
“Convert”isatoolthatwrapsacommandlinetoolprovidedbySunMicrosystemstoallowconvertingaJavaCardpackageintoaCAPfile.ThetoolalsooptionallygeneratesaEXPfileandaJCAfile.TheCAPfileisaJAR-formatfilewhichcontainstheexecutablebinaryrepresentationoftheclassesinapackage.AEXPfileisaJavaCardexportfilethatcontainsthepublicAPIlinkinginformationofclassesinapackage.AJCAfileisaJavaCardassemblyfile,whichcouldbeusedtoregenerateaCAPfile[3].Figure10showsthepopupmenuthatappearsafterrightclickingaJavaCardpackage,andFigure11showstheoutputafterselectingtheConvertmenuitem.
Figure10:
Convertpopupmenuitem
Figure11:
Convertoutput
“GenerateScript”isatoolthatwrapsacommandlinetoolprovidedbySunMicrosystemstoallowgeneratingJavaCardpackageandappletinstallationAPDUscripts.ExtraAPDUscriptlineshavebeenautomaticallyaddedtothescriptgeneratedbySun’stooltomakeitmorefeasiblefordirectrunningonasimulator.TheGenerateScriptpopupmenuitemappearsafterrightclickingaJavaCardpackage,aJavaCardappletoraCAPfile.Figure12showsthepopupmenuthatappearsafterrightclickingoneofthepreviouslymentionedcomponents,andFigure13showstheoutputafterselectingtheGenerateScriptpopupmenuitem.
Figure12:
GenerateScriptpopupmenuitem
Figure13:
GenerateScriptoutput
“RunScript”isatoolthatwrapsacommandlinetoolprovidedbySunMicrosystemstoallowsendingtheAPDUcommandsofanAPDUscriptfiletoasimulator.Figure14showsthepopupmenuthatappearsafterrightclickinga.scriptfilethatcontainsAPDUscript.
Figure14:
RunScriptpopupmenuitem
Simulators
“CREF”isaJCREreferenceimplementationwritteninC-languageprovidedbySunMicrosystems.ItisasimulatorthatismuchlikearealJavaCardtechnology-basedimplementationbutitdoesnotsupportrunningJavaCardapplicationsindebugmode[3].CREFiswrappedinsideEclipseJCDEtoautomatetheprocessofstartingit,sendingargumentstoitaccordingtothestoredpreferencesandstoppingit.Figure15showstheCREFmenuandFigure16showsitpreferencesdialog.Thepreferencesarestoredintheproject’sworkspaceandareusedtoconstructtheargumentsthatwillbesenttothesimulatorwhilestarting.
Figure15:
CREFmenu
Figure16:
CREFpreferences
“JCWDE”orJavaCardWorkstationDevelopmentEnvironmentisanothersimulatorprovidedbySunMicrosystems.ItsupportsrunningJavaCardapplicationsindebugmode.ItisajavaapplicationthatemulatestheJCREbutlackssomeofitsfeatures.JCWDEiswrappedinsideEclipseJCDEtoautomatetheprocessofstartingitinnormalordebugmode,sendingargumentstoitaccordingtothestoredpreferencesandstoppingit.Figure17showstheJCWDEmenuandFigure18showsitpreferencesdialog.Thepreferencesarestoredintheproject’sworkspaceandareusedtoconstructtheargumentsthatwillbesenttothesimulatorwhilestarting.
Figure17:
JCWDEmenu
Figure18:
JCWDEpreferences
Validations
EclipseJCDEprovidesasetofcompile-timevalidationstovalidatetheconsistencyofaJavaCardprojecttoavoidruntimeerrorswhileinstallingorrunningaJavaCardapplicationonasimulator.
EclipseJCDEappliesthefollowingvalidations:
-
“AppletAIDvalidation”:
CheckseveryJavaCardappletinaJavaCardprojectfortheexistenceofappletAID.
“PackageAIDvalidation”:
CheckseverypackageinaJavaCardprojectfortheexistenceofpackageAID.
“DuplicateAIDvalidation”:
CheckseveryJavaCardprojectfortheinexistenceofduplicateAIDs.
Figure19andFigure20showscreenshotsforexamplesofvalidationerrors.
Figure19:
EclipseJCDEvalidationerrorsappearingasexclamationmarks
Figure20:
EclipseJCDEvalidationerrorsappearingaswarningmessages