Why Json test program doesn't work?

前端 未结 1 1241
渐次进展
渐次进展 2021-02-02 10:46

When I run a Json test program with jdk 7, it says :

Exception in thread \"main\" javax.json.JsonException: Provider org.glassfish.json.JsonProviderImpl not fou         


        
相关标签:
1条回答
  • 2021-02-02 11:06

    javax.json-api-1.0.jar contains only API which is there for compile time dependency. But if you want to run your app, you need a provider / impl classes.

    org.glassfish:javax.json is the jar you need that contains both api + impl classes.

    <dependency>
        <groupId>org.glassfish</groupId>
        <artifactId>javax.json</artifactId>
        <version>1.0.4</version>
    </dependency>
    

    See this thread for more details.

    0 讨论(0)
提交回复
热议问题