【发布时间】:2018-06-02 18:29:04
【问题描述】:
根据following guide,我已经安装了新版本的Java Card Platform Development Kit。这包括所有先决条件,以及 JCDK 的 3.0.5u2 版本。作为提醒,我尝试在两台不同的计算机上安装它(一台装有 Win7,另一台装有 Win10)并在两台计算机上都重新安装了所有内容。
我遇到的问题是没有一个示例项目可以正确构建。例如,当我尝试构建 HelloWorld 示例时,我会在构建控制台中打印以下文本:
[ INFO: ] Converter [v3.0.5]
[ INFO: ] Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
[ INFO: ] conversion completed with 0 errors and 0 warnings.
[ INFO: ] Converter [v3.0.5]
[ INFO: ] Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
[ INFO: ] conversion completed with 0 errors and 0 warnings.
Missing file containing component hashes.
usage: scriptgen [-options] -hashfile <hash file path> <cap File Path>
where options include:
-help Print this message and exit.
-o <filename> Output filename. default: stdout
-version Print version number and exit.
-nobanner Do not print banner.
-nobeginend Suppress "CAP_BEGIN", "CAP_END" APDU commands.
-package <pkgname> Package name.
虽然常规控制台有这样的说法:
Executing "$JC_CLASSIC_HOME\bin/converter.bat" -debug -nobanner -out CAP JCA -classdir "$JC_CLASSIC_HOME\samples\classic_applets\HelloWorld\applet\bin" -d "$JC_CLASSIC_HOME\samples\classic_applets\HelloWorld\applet\deliverables" -exportpath "$JC_CLASSIC_HOME\api_export_files" -applet 0xA0:0x00:0x00:0x00:0x62:0x03:0x01:0x0C:0x01:0x01 com.sun.jcclassic.samples.helloworld.HelloWorld com.sun.jcclassic.samples.helloworld 0xA0:0x00:0x00:0x00:0x62:0x03:0x01:0x0C:0x01 1.0
Executing "$JC_CLASSIC_HOME\bin/scriptgen.bat" -package com.sun.jcclassic.samples.helloworld -o "$JC_CLASSIC_HOME\samples\classic_applets\HelloWorld\applet\apdu_scripts/cap-com.sun.jcclassic.samples.helloworld.script" "$JC_CLASSIC_HOME\samples\classic_applets\HelloWorld\applet\deliverables/com/sun/jcclassic/samples/helloworld/javacard/helloworld.cap"
java.io.FileNotFoundException: $JC_CLASSIC_HOME\samples\classic_applets\HelloWorld\applet\apdu_scripts\cap-com.sun.jcclassic.samples.helloworld.script (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
... (stack trace)
现在,我不能 100% 确定,但我认为当我安装了 3.0.5u1 版本时,我能够构建示例项目。
【问题讨论】:
-
您确定 $JC_CLASSIC_HOME 扩展良好吗?我不希望它在异常中按名称出现...检查您的环境变量,并设置变量!
-
不完全确定您所说的扩展是什么意思,但我在上面的帖子中使用 $JC_CLASSIC_HOME 作为我实际路径的占位符。 JC_CLASSIC_HOME确实是一个环境变量,指向C:\Program Files (x86)\Oracle\Java Card Development Kit 3.0.5u2\。
-
DOS/Windows 使用
%JC_CLASSIC_HOME%。我仍然认为这只是环境。变量。