3

Under Java 9, various default packages have been switched to Java EE packages (no longer included in JVM - optionally addable). This is not a problem for most of them because I simply specify the Java EE packages as dependencies. With the said package javax.smartcardio, however, I didn't find anything where it could have landed (github-jee, no Maven search result,...). Can someone give me a tip where to get the latest version of the package? Thank you much!

I have just found out that javax.smartcardio still exists as a module java.smartcardio. However, this doesn't help me because I am still working with the ClassPath in my project and would have to work with Jigsaw to get it.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
spellsleeper
  • 61
  • 1
  • 7
  • *I have just found out that javax.smartcardio still exists as a module java.smartcardio* So, what are you asking now? – Elliott Frisch Jan 10 '18 at 15:55
  • Could you explain what do you mean when you say *this doesn't help me because I am still working with the ClassPath in my project* when `module java.smartcardio` is present in the JDK itself? – Naman Jan 10 '18 at 16:05
  • I'm working in my application without an moduldescriptor. So I can't use the module 'java.smartcardio'. If I would use a module-info.java I should have to use the module system in the full application. – spellsleeper Jan 11 '18 at 08:57
  • My goal is that I create a JAR with javax.smartcardio included or which automaticly reads the module java.smartcardio(manifest?). So that it runs with Java 9. Again, using module-info seems to be no solution for me. – spellsleeper Jan 17 '18 at 13:27
  • I have the same problem, please let me know if you solved. – Andrea Mariottini Apr 19 '18 at 14:56

3 Answers3

0

Use a module-info.java to require the java.smartcardio module. This worked for me.

I posted a bit more detailed answer here: https://stackoverflow.com/a/61721513/7287324

Chemah
  • 538
  • 6
  • 18
-1

I verified that at runtime javax.smartcardio is available out of the box if you are on the classpath.
No --add-modules is required.

Andrea Mariottini
  • 441
  • 1
  • 5
  • 6
-2

I had the same problem because I was using a project with Java 8 for compile time.

You have to add this to your POM

<!-- https://mvnrepository.com/artifact/javax/javaee-api -->
<dependency>
    <groupId>javax</groupId>
    <artifactId>javaee-api</artifactId>
    <version>XXXX</version>
    <scope>provided</scope>
</dependency>

Then it compiles ok.