I tried to configure NetBeans(7.2) project to use Tess4J library.
Unfortunately all I get is runtime error:
Exception in thread "main"
java.lang.NoClassDefFoundError:
com/sun/media/imageio/plugins/tiff/TIFFImageWriteParam
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:166)
After some time of testing and trying I made a simple Tess4J project in Eclipse and everything is working fine but I don't want to convert whole my project to eclipse.
Both projects are configured the same way, yet NetBeans is refusing to work for some reason.
I've found one possible solution on StackOverflow to put libtesseract302.dll, liblept168.dll and tessdata in jdk/bin folder instead of project folder but I don't have administrator rights on the machine so that is out of the question.
Is there other way to make Tess4J work in NetBeans?
I also encountered the same issue under a windows version of tomcat.
Exception in thread "main" java.lang.NoClassDefFoundError: net/sourceforge/tess4j/Tesseract
and also
Unable to load library 'libtesseract302' problem (Tesseract is a 32-bit app).
I solved it by adding liblept168.dll and libtesseract302.dll to C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.37\bin (emplacement of the binaries of tomcat) and by linking the jar or the source code provided by Tess4j to my project.
Anyway, under Linux, everything went fine only by referencing the Tess4j project (and with Leptonica installed and data file in the right place)
Hope this helps, enjoy ;)
Tess4J is itself a NetBeans project. You would only need to open the project, expend the Test Packages, and execute the included unit tests -- no need to copy files anywhere.
Related
I am trying to use a library called Journey browser which uses the Java Chromium Embedded Framework. I first created a Java Maven Project with Netbeans and I edited the pom.xml to match the values on the library's guide, which is here: https://github.com/CodeBrig/Journey, to add the maven dependencies. (No errors detected by Netbeans) I then built the project to download the maven dependency and put their default code (modified slightly) in the main class. Netbeans found no errors in the code. However, when I run the project I get a "no chrome_elf in java.library.path". I think this has something to do with embedding JCEF, but I am not sure how to add this to the "java.library.path" in Netbeans.
How do I fix this "chrome_elf" problem?
Also, if I am able to fix this will it be an error for production if someone doesn't have "chrome_elf" installed?
For Windows
This happens because the chrome_elf.dll (on Windows) file cannot be found.
Java is looking for this file on java.library.path - which (on my machine, anyway) refers to all the locations referenced by the Windows %path% environment variable.
One way to fix this is to download one of the pre-built distributions from that GitHub page (for example the Windows one, referred to here):
https://github.com/CodeBrig/Journey/releases/download/0.4.0-78-assets/jcef-distrib-windows64.zip
Then unzip the resulting jcef-distrib-windows64.zip. In the win64\bin\lib\win64 directory under that main directory you will find the chrome_elf.dll you need - and other binaries which are also needed.
Add this directory to your path - either by adding it to the Windows environment variable or via java -Djava.library.path=....
For example, the path may be similar to this:
C:\your\path\to\jcef-distrib-windows64\win64\bin\lib\win64
This should allow you to run the demo code provided in the JourneyBrowser class. A browser window should open as a result.
Here is the browser:
The above steps worked for me - and the only files I needed to keep from the (large) distribution download were those in the jcef-distrib-windows64\win64\bin\lib\win64 directory. It's possible that I already have some other dependencies which may be needed - so I cannot guarantee this process will also work for you.
For Linux (and MacOS)
I have not tried this on a Linux machine. But in that case, I believe you will need to download and unzip the jcef-distrib-linux64 release - and then point to the jcef-distrib-linux64\linux64\bin\lib\linux64 directory, containing libcef.so and other libraries.
Similarly for MacOS, there is a distribution which can be downloaded and unzipped.
Alternative
An alternative is to simply use the pre-built distributions provided on GitHub, using the commands provided. Obviously, in this case, you will not be creating your own customized implementation (so, no JourneyBrowser class).
copy scr/native/Release to jcef_build/native/Release from the default output directory of VS.check whether the Release exists in java.lib.path
if someone could help that would be amazing.
This project is being started in the NetBeans IDE EE version that comes with GlassFish Server. I've used Lucene to make a searchable twitter index of ~5G and am getting the NoClassDefFoundError only when called from the server giving a 500 Page Error.
The problem really confuses me, NetBeans is able to compile and run the code. When I call my functions from the same project in the IDE I'm able to use it perfectly. When I compile to a WebProject and launch it seems like GlassFish isn't able to find the files but I've made sure it has all the jars in the WAR file in the proper directories.
I've tried this both manually adding all the library files and by using Maven. Neither have worked, I've even added classpaths to the files elsewhere and added the files to glassfishes /lib folder.
Here is my setup.
http://imgbin.org/images/22748.PNG
I guess the problem is that you are mixing two different versions of lucene together (3.4 and 4.0).
I don't know why this works on your local Glassfish instance but you should update your dependencies so that they all have the same version.
I am trying to setup a java based opencv program to run on raspberry-pi.I installed opencv-2.4.8 on my raspberry-pi. I also installed eclipse to set up opencv.The problem is i am not able to link native libraries for my opencv-2.4.8 jar file in eclipse.
Eclipse is running fine with raspberry-pi and i am able to compile and run simple java programs.From where to link the native library for opencv2.4.8 jar file.
I checked my opencv folder and it is having the following structure.
MY OpenCV Folder
Opencv release folder
Found the following opencv .so files in usr/local/lib folder of my pi. Is this is what i should link to my native library. But there are many .so files also.
The output console with the error is as follows. sorry the screenshot skipped unsatisfied link error..
I had the same error which come up like this. I have an application that I have to run. I build and install opencv and try to run but I see that error like you. For solving this issue I replace old opencv_*jar with built one in opencv directory. You have to use jar file that you have just built.
..../opencv/build/bin/opencv-2410.jar
I thing old jar looks for different native path.
I had the same issue. I set my Native Lib Location to {OpenCV directory}/{Build directory}/lib and things worked fine.
I created a runnable .jar file from a project I built in Eclipse Juno. The project uses the JRE7 and JavaFX libraries, which I added to the build path.
Build Path Settings
The .jar file executes successfully on Windows 7 machines. However, when I try to run the .jar file on a WindowsXP machine, it fails with the following linking error:
Error on WindowsXP
The error reads:
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: com.sun.glass.ui.win.WinApplication._invokeLater(Ljava/lang/Runnable;)V
at com.sun.glass.ui.win.WinApplication._invokeLater(Native Method)
at com.sun.glass.ui.Application.invokeLater(Application.java:338)
at com.sun.javafx.tk.quantum.QuantumToolkit.defer(QuantumToolkit.java:620)
The error occurs just as the program tries to load a class that uses JavaFX, The WindowsXP machine has Java Version 7 Update 40 which comes with JavaFX, so I can't figure out why it would fail.
Could this be a 32-bit vs. 64-bit problem?
Also, on the build path settings, I wonder if I'm including the right JavaFX jar file. I have two to choose from and I'm not exactly sure which one to include. I assume it's the second one because it's part of the JRE.
C:\Program Files\Java\jdk1.7.0_25\jre\lib\jfxtr.jar
C:\Program Files (x86)\Java\jre7\lib\jfxtr.jar
Thanks
1. JavaFX is embedded into JRE, but it is the separate library still now. So, if you use the JavaFX classes in your project, JVM should "know" about that. Your *.jar file should contain info about jfxrt.jar. How to do that?
2. JRE folder used for running the apps, such as *.jar files. JDK/JRE folder used when you developing your apps from IDE. So, you should use the C:\Program Files\Java\jdk1.7.0_25\jre\lib\ path for your project build path' libs.
As far as I know, there is no way to run JavaFX applications on Windows XP.
Despite all of my efforts, I couldn't get the .jar file to execute in Windows XP when I created it in Eclipse. But I could get it to work when the project was exported out of NetBeans. The trick was: I created a new "JavaFX in Swing Application" in NetBeans. That way, the IDE imported all of the necessary libraries for JavaFX. I copied all of my .java files from Eclipse into the new NetBeans project and it worked. Happy with NetBeans!
I've been getting this Java runtime error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jogl in java.library.path
This is to do with having difficulty loading the dependent native libraries required to use Java OpenGL. It's an issue that's all over the net; there are some dependent files that need to be on the classpath. I've tried following the java -Djava.library.path "path/to/dir" method of registering the DLLs but it hasn't seemed to help. I think it may be because I'm trying to run this application within the Netbeans IDE.
What's odd is that I've downloaded the Netbeans JOGL plugin and their example application which shows off some basic OpenGL functions perfectly! I've searched through the code and there's no custom DLL loading, nor is there any project-specific configuration settings that I can see. I have no idea what's going on!
If you refer to jogamp.org's JOGL, please have a look at our Wiki page for IDEs.
Thx to our automated native JAR library loading,
you don't even have to set a native library path at all.
Works well w/ Eclipse - and as I heard w/ Netbeans too.
Pls don't forget to attach the source zip file to the matching gluegen/jogl
jar file, so you can benefit from our javadoc.
Check the setting of example application.
For example, in eclipse you should add jars into build path (which can be accessed from project settings)
Also u can try this plugin: http://plugins.netbeans.org/plugin/11451/addtolibrary