【发布时间】:2015-12-04 03:21:40
【问题描述】:
我从Oracle官网下载了Java Card Connected Edition 3.0.2并安装了它。 JCDK 中有一些web samples。在书面文件中:
所有示例都必须在 NetBeans IDE 中运行。他们不能从 此版本的开发工具包中的命令行。
Samples 可以正确地与 NetBeans IDE 配合使用。我可以导入它们并在 Java Card 平台上运行。
但我想在 Eclipse IDE 上使用这些示例。在 Eclipse 中作为 Java Card SDK 路径,我显示了 Java Card Connected 主路径。然后创建新设备并尝试启动它[例如CardHolderApp]。但是 Eclipse 给出了:
ApduTool thread exited
User input thread exited
APDU|ApduTool [v3.0.2]
APDU| Copyright (c) 2009 Sun Microsystems, Inc.
APDU| All rights reserved.
APDU| Use is subject to license terms.
APDU|Opening connection to localhost on port 9025.
APDU|Connected.
APDU|java.net.ConnectException: Connection refused: connect
ApduTool process finished with code: 1
.log 文件:
!ENTRY org.eclipse.core.jobs 4 2 2015-09-08 01:39:17.142
!MESSAGE An internal error occurred during: "Launching CardHolderApp".
!STACK 0
java.lang.RuntimeException: Cannot start device. Please see the log.
at com.oracle.javacard.jcdk.launch.runconfiguration.AppletRunConfigurationDelegate.launch(AppletRunConfigurationDelegate.java:79)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
是否可以在 Eclipse IDE 中运行 Java Card Connected Web 项目?
更新:
设备启动成功。但项目未部署。它在每次使用 String 时都会给出“不支持的字符串类型常量”。 代码示例:
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
response.setContentType("text/html"); // unsupported String type constant
PrintWriter out = response.getWriter();
RequestDispatcher dispatcher = null;
dispatcher = request.getRequestDispatcher("/WEB-INF/header.i");//unsupported String type constant
response.sendRedirect(response.encodeRedirectURL("http://www.sun.com"));//unsupported String type constant
dispatcher.include(request, response);
dispatcher.include(request, response);
}
经典版不支持字符串。但它必须在 Connected Edition 上运行。
【问题讨论】:
-
你看过eclipse-jcde.sourceforge.netEclipseJCDE吗?
-
据我所知是经典版。不适用于 servlet。
-
你检查过the plugin provided by Oracle吗?它还写着“经典版”,但我会试一试。
-
是的,我也检查过了。我无法让它与 Connected Edition 一起使用。
标签: java eclipse netbeans eclipse-plugin javacard