java: package org.yaml.snakeyaml does not exist

Cause of error java: package org.yaml.snakeyaml does not exist

This error java: package org.yaml.snakeyaml does not exist occurs while working with the SnakeYAML and maven. One can get this error when they run their .jar file. It can be possible that you may not get any errors while compiling with maven. The error comes as shown below: 

 

 

Solution

SnakeYAML is a YAML-parsing package that offers a high-level API for YAML document serialization and deserialization. The Yaml class, like the ObjectMapper class in Jackson, serves as the entry point for SnakeYAML.

Data is in a POJO object in Java. Create an object mapper using the YAML implementation class’s writeValue method, which turns a POJO object into a YAML file. Finally, the YAML format is used to serialize POJO data.

The solutions to the above problems relate to the SnakeYaml which you are including in the JAR. If you are not including the SnakeYaml in your JAR file you need to do the following steps to solve the above problem: 

  • Use Maven’s uber-jar plugin to include it,
  • Use Maven’s uber-jar plugin to include it, the YAML JAR’s classpath when executing the JAR,
  • or the exec plugin when launching the JAR to enable dependency detection.

Another solution is to add the dependency plugin which is a necessity for the packing. 

 

 

Also Read: no matching function for call to rctbridgemodulenameforclass

 

 

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *