简体   繁体   English

neo4j:简单的示例抛出java.lang.NoClassDefFoundError:scala / Function0

[英]neo4j: simple exampel throws java.lang.NoClassDefFoundError: scala/Function0

I try to build up a very simple neo4j db for practicing: 我尝试建立一个非常简单的neo4j db进行练习:

public static void main(String[] args) {
    Map<String, String> config = new HashMap<String, String>();
    config.put( "neostore.nodestore.db.mapped_memory", "10M" );
    config.put( "string_block_size", "60" );
    config.put( "array_block_size", "300" );
    GraphDatabaseService graphDb = new GraphDatabaseFactory()
        .newEmbeddedDatabaseBuilder( "db" )
        .setConfig( config )
        .newGraphDatabase();

    ExecutionEngine engine = new ExecutionEngine(graphDb, StringLogger.DEV_NULL);
}

I get the following exception while executing it: Exception in thread "main" java.lang.NoClassDefFoundError: scala/Function0 我在执行它时得到以下异常:线程“ main”中的异常java.lang.NoClassDefFoundError:scala / Function0

Do you have any idea how to get it working? 您有任何想法如何使其工作吗?

Questions about this error is listed among the common Java questions on the 'java' tag wiki , and for a general answer you can begin by reading about it here . 关于此错误的问题已列在'java'标签wiki上的常见Java问题中,对于一般性的回答,您可以从这里开始阅读。 To know why the class definition cannot be found in your specific case it would be helpful first to know exactly what definition it is that cannot be found, so please edit your question to include the full stack trace. 要了解为什么无法在您的特定情况下找到类定义,首先要准确地知道它是什么定义,这将对您有所帮助,因此,请编辑您的问题以包括完整的堆栈跟踪。 Maybe someone else will recognize your exact error, all I can see from that one line is that the JVM is unable to load some Scala definition, and that probably you need to include some missing dependency or clean up conflicting versions in your dependency tree. 也许其他人会认出您的确切错误,我从那一行中只能看到JVM无法加载一些Scala定义,并且可能您需要在依赖关系树中包括一些缺少的依赖项或清理有冲突的版本。

我们的解决方案是在我们的IDE中添加scala支持。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM