Search code examples
javakotlinsmartcardio

javax.smartcardio.* is not found on Open JDK 11(Redhat)


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.

Enviornment : Redhat OpenJDK 11, Intellij, Kotlin, Gradle

> 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

Also, I already looked classpath, and there is 'java.smartcardio' I attached a screenshot below.

classpath

What should I do?

ADD----------------

Wired thing is in Java code, it is working on same project. I think there is a problem with Kotllin environment settings.


Solution

  • 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.

    Here it is.

    https://github.com/intarsys/smartcard-io