Why Json test program doesn't work?

前端 未结 1 1244
渐次进展
渐次进展 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.

    
        org.glassfish
        javax.json
        1.0.4
    
    

    See this thread for more details.

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