java能同时运行两个jar吗,如何在我的java项目中使用两个版本的jar

In my java project, I need to use neo4j-1.9.3 that depends on lucene-3.6.2, and ElasticSearch which depends on lucene-4.4.0. I know that if I want to use two versions of lucene directly, I can use ClassLoader to load different classes from the lucenes.

But the problem is that I won't use lucene's apis directly now. Is there any way that lucene-3.6.2 can be loaded when neo4j's apis are running, and lucene-4.4.0 can be loaded while running elasticsearch's apis. The two versions of lucene conflict now, and I need to run neo4j and elasticsearch in one project. How could I solve the dependency problem?

Thanks in advance.

解决方案

You could still use a ClassLoader solution, but that is a nasty business where it is easy to make mistakes.

You could also use different JVM's.

But the solution I would personally choose is either (or both) of the following:

Verify that Neo4J breaks with Lucene 4.x. Maybe you will get lucky and there won't be any problems using the latest version.

Split them up into two applications where one of them, say Neo4J, is accessed by the other application via web service (most likely REST) calls. Neo4J has a built-in REST API anyway.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
java oracle.spatial是Oracle提供的用于处理空间数据的Java开发工具包。其包含了两个重要的jar文件:sdoapi.jar和sdoutl.jar。 sdoapi.jar是Spatial Data Objects (SDO) API的缩写,是Oracle Spatial提供的Java API。它包含了一系列用于处理和操作空间数据的类和方法。通过sdoapi.jar,开发人员可以在Java应用程序对Oracle数据库的空间数据进行增删改查操作。例如,可以使用sdoapi.jar来读取和解析包含空间信息的数据,查询空间数据的属性和空间关系,创建和修改空间对象等。sdoapi.jar提供了一种方便的方式来处理各种类型的空间数据,如点、线、面、多边形等。它使得在Java开发环境下进行空间数据处理成为可能。 sdoutl.jar是Spatial Data Utilities的缩写,是Oracle Spatial提供的一组工具类。它包含了一些实用方法和功能,用于执行常见的空间数据操作和转换。例如,使用sdoutl.jar可以将非空间数据转换成空间数据,进行空间数据的缓冲区分析,计算两个空间对象之间的距离等。sdoutl.jar提供了一些便捷的方法和工具,能够简化空间数据的处理和分析过程。 通过使用两个jar文件,开发人员可以在Java应用程序方便地进行空间数据的处理和分析。无论是查询和修改已有的空间数据,还是进行一些空间分析的计算,都可以利用Java和Oracle Spatial提供的功能来实现。它们为开发人员提供了一种高效且灵活的方式来处理和操作空间数据。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值