如何从Eclipse为javaCV或openCV项目提供可运行的jar [英] how to make runnable jar for javaCV or openCV project from Eclipse

查看:295
本文介绍了如何从Eclipse为javaCV或openCV项目提供可运行的jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Eclipse中有一个openCV项目。现在我试图让它可运行的Jar,但无法启动它,一旦尝试运行jar。
我试过以下 -
https://groups.google .com / forum /#!topic / javacv / ziqKIb7PgYk



但我无法正确理解。任何人都可以解释正确的方式来做有需要的事情。


在我的系统中,安装了OpenCV。一旦我尝试从
eclipse运行项目,一切都可以正常运行。但是当我尝试从
runnabelJar中执行相同操作时,它不会。问题我发现我没有包含
.dll文件,所以我该怎么做。



解决方案

我终于得到了解决方案。是的,我们可以在使用javaCV时轻松地从Eclipse中创建Runnable jar,不需要ant或maven构建。



否需要使用OpenCV设置类路径使用javaCV并且不打算进行jni构建。




  • 创建Java项目。

  • 复制所有jars.You可以避免x86或linux或不需要的jar为
    好​​。






  • 查找jre版本,如果32位,得到OpenCV 32位
    库的路径64位。您可以将这些DLL放在
    系统中的任何位置。不需要放置任何特定路径。

  • 转到OpenCV jar,展开它,单击Native Library Location,
    编辑并浏览路径





这样做,工作完成,现在使Runnable jar或任何东西,它将像魅力一样工作。

一旦将runnable jar提供给任何用户,那么用户的openCV路径应该设置在类路径中,或者提供dll,并且您可以将库加载到任何静态阻止。


I have a openCV project in eclipse. Now I am trying to make it runnable Jar but not able to launch it , once trying to run the jar. I tried following - https://groups.google.com/forum/#!topic/javacv/ziqKIb7PgYk

but I couldn't understand properly. Can anyone explain the proper way to do the needful.

in my System , OpenCV is installed. Once I try to run the project from eclipse , everything works fine . but when I try to do the same from runnabelJar it doesn't. The problem I found it that I didn't include .dll files , so how should I do it.

解决方案

I finally got the solution. Yes we can easily make Runnable jars from eclipse while using javaCV , no need for ant or maven build.

No Need to set the class path with OpenCV, which you are only using javaCV and no intention for jni build.

  • Create a Java Project.
  • Copy all the jars.You can avoid x86 or linux or non required jars as well.

  • Find the jre version , if 32 bit , get the path of OpenCV 32 bits libraries else 64 bits. You can place those dlls any where in the system.. No need to place it any specific path.
  • Go to OpenCV jar , expand it , click on Native Library Location , edit and browse the path

Thats it , job Done , now make Runnable jar or anything , it will work like charm.

Once you provide your runnable jar to any user, then either user's openCV path should be set in the class path or you provide the dlls , and you Load the library in any static block.

这篇关于如何从Eclipse为javaCV或openCV项目提供可运行的jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆