Provider org.glassfish.json.JsonProviderImpl not found at javax.json.spi.JsonProvider.provider(JsonProvider.java:97)

后端 未结 1 1707
囚心锁ツ
囚心锁ツ 2020-12-30 02:02

How to run Java API for JSON Processing(JSR 374) in eclipse?

I am trying to parse JSON string to JsonParser(javax.json.stream.JsonParser). Also add

相关标签:
1条回答
  • 2020-12-30 02:48

    You're developing against an API and have no implementation for that API. You need to make sure you have an implementation of the JSON-P specification to actually run the code you're trying to use.

    In the JSR 374 official website Getting Started guide, it shows that you need two Maven dependencies - one for the API and one for the reference implementation - before you can use JSON-P 1.1:

    <dependency>
        <groupId>javax.json</groupId>
        <artifactId>javax.json-api</artifactId>
        <version>1.1</version>
    </dependency>
    
    <dependency>
        <groupId>org.glassfish</groupId>
        <artifactId>javax.json</artifactId>
        <version>1.1</version>
    </dependency>
    

    Since it looks like you're not using Maven, you will need to download the implementation JAR from Maven Central manually: https://repo1.maven.org/maven2/org/glassfish/javax.json/1.1/

    Or just click this direct link to download the JAR: javax.json-1.1.jar

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