问题描述
我正在使用Redhat的OpenJDK 11与Windows上的智能卡进行通信.但是我在编译时遇到了问题.它说找不到javax.smartcardio库.
I am using Redhat's OpenJDK 11 to communicate with a smart card on the Windows. But I have a problem with compiling. It said cannot find javax.smartcardio library.
> Task :compileKotlin
e: ~\util\SmartCard.kt: (7, 14): Unresolved reference: smartcardio
e: ~\util\SmartCard.kt: (13, 25): Unresolved reference: CardTerminal
e: ~\util\SmartCard.kt: (13, 41): Unresolved reference: TerminalFactory
e: ~\util\SmartCard.kt: (19, 51): Unresolved reference: CardTerminal
e: ~\util\SmartCard.kt: (25, 43): Unresolved reference: CardTerminal
e: ~\util\SmartCard.kt: (35, 23): Unresolved reference: Card
e: ~\util\SmartCard.kt: (36, 30): Unresolved reference: CardChannel
e: ~\util\SmartCard.kt: (44, 52): Unresolved reference: CardException
e: ~\util\SmartCard.kt: (51, 19): Unresolved reference: CardException
e: ~\util\SmartCard.kt: (54, 27): Unresolved reference: CommandAPDU
此外,我已经查看了类路径,并且在下面附加了一个屏幕截图.其中是"java.smartcardio".
Also, I already looked classpath, and there is 'java.smartcardio' I attached a screenshot below.
我该怎么办?
ADD ----------------
ADD----------------
有线的东西是用Java代码编写的,它正在同一个项目中工作.我认为Kotllin环境设置有问题.
Wired thing is in Java code, it is working on same project. I think there is a problem with Kotllin environment settings.
推荐答案
这里是另一种方法.我只是放弃使用JDK的SmartCard类,因为很难在JDK 11版本上使用JDK.取而代之的是,我使用了来自Github的库.
Here is an alternative way. I just give up using JDK's SmartCard classes since it was hard to use JDK one on JDK 11 version. Instead of it, I used a library from Github.
在这里.
https://github.com/intarsys/smartcard-io
这篇关于在Open JDK 11(Redhat)上找不到javax.smartcardio.*的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!