Hibernate 5 issue with JDK 9

前端 未结 2 1750
执笔经年
执笔经年 2020-12-02 00:51

I have a Hibernate 5 project that perfectly builds and runs on Java 8. I tried to test it on JDK 9 ea build 171. Since it is a huge project and have other dependencies I ha

2条回答
  •  栀梦
    栀梦 (楼主)
    2020-12-02 01:20

    Though the question seems old, yet unanswered and since the GA release of JDK is completed. According to the migration guide and the java docs, since the module java.transaction which exports the package javax.transaction has been marked as @Deprecated.

    You should ideally migrate your code to be using javaee/javax.transaction instead. Currently, you can do so using automatic module converted from the dependency:

    
        javax.transaction
        javax.transaction-api
        1.2
    
    

    and adding to the module-info.java the following:-

    requires javax.transaction.api;
    

    Edit: Thanks to @ImpulseTheFox for verifying that the automatic module name for the jar version 1.3 above requires:-

    requires java.transaction;
    

提交回复
热议问题