0

I'm writing a small java program that needs to use SnakeYAML, and it works fine when running it from within Eclipse, but when I export it, it can't seem to locate the SnakeYAML class to handle the Yaml object, like in the Yaml yaml = new Yaml(); declaration.

I imported the snakeYAML Jar library as an external Jar, which I suspect may cause it not to compile the library with it, how do I fix this?

In particular, this is the error line referring to what I'm talking about whilst launching it outside of Eclipse:

java.lang.ClassNotFoundException: org.yaml.snakeyaml.Yaml

As I side note, I'm typically accustomed to writing Minecraft bukkit plugins, hence they way I import the Bukkit libraries is how I imported the SnakeYAML libraries.

4

1 回答 1

0

您必须导出一个可运行的 JAR 文件,这应该可以解决您的问题。右键单击项目 -> 导出... -> “可运行的 JAR 文件” -> 选择您的项目 -> 完成

于 2012-08-02T09:32:28.853 回答