Results 1 to 12 of 12
- 05-22-2008, 11:04 AM #1
Member
- Join Date
- Apr 2008
- Posts
- 19
- Rep Power
- 0
Project works in debugger, not after compiling
Hi people,
I'm working on a project that i got from the internet and which I need to modify to my needs.
The project contains 2 jar files that need to be set in the libraries.
The project works fine in the netbeans debugger, but when I compile it it returns the following error:
The 2 jar files are copied into a lib subdirectory.Exception in thread "main" java.lang.UnsatisfiedLinkError: be.belgium.eid.eidlib
JNI.new_BEID_ID_Data()J
at be.belgium.eid.eidlibJNI.new_BEID_ID_Data(Native Method)
at be.belgium.eid.BEID_ID_Data.(BEID_ID_Data.java:141 )
at eid.Main.main(Main.java:20)
Apparently something is wrong with the libraries, but I can't seem to figure out what. I found some dll's in the windows system32 directory that are likely to be used by the program. I copied them both to the jar file's folder and the lib subdirectory, but no luck there
Googling thought me that i need to set the java_library_path but I'm not sure how to do this in netbeans.
did not help eitherjava -jar "eid.jar" -Djava.library.path="lib"
Can anyone point me in the right direction?
- 05-22-2008, 11:14 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Can you tel me the exact folder structure of dist folder. If you are working on NetBeans there is a folder name dist inside the working folder.
- 05-22-2008, 11:22 AM #3
Member
- Join Date
- Apr 2008
- Posts
- 19
- Rep Power
- 0
hi,
projectfolder
\_build
\_dist
---\_lib
\_nbproject
\_src
\_test
nothing else
- 05-22-2008, 11:38 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Ok, inside lib you should have all libraries refer in your project. And also main executable jar file should be inside the dist and outside of the lib. Is that right?
- 05-22-2008, 05:12 PM #5
Member
- Join Date
- Apr 2008
- Posts
- 19
- Rep Power
- 0
this seems to be the case, however, in the meantime i have found that the jar files in the lib use dll's that are in the windows system32 directory.
I tried copying these files in the lib and in the dist folder.
I tried loading them into the program by using in the source code the line:
Nothing works...Java Code:System.loadLibrary("my.dll");
Very strange since things just work inside netbeans...
- 05-22-2008, 10:12 PM #6
Probably you should specify a class path when you try to run?
Daniel @ [www.littletutorials.com]
Language is froth on the surface of thought
- 05-23-2008, 04:02 AM #7
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Can you find manifest file of your project. Check there from where those dll files are linked. Normally those details are included in manifest file.
- 05-28-2008, 01:19 PM #8
Member
- Join Date
- Apr 2008
- Posts
- 19
- Rep Power
- 0
still no luck with this
manifest file:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.0
Created-By: 10.0-b19 (Sun Microsystems Inc.)
Main-Class: eidlibtest.Eid
Class-Path: lib/beidlib.jar lib/eidlib.jar
X-COMMENT: Main-Class will be added automatically by build
nothing there about the dll's
System.getProperty returns the windows/system32 directory where the dll's are located.
Actually this is in the code:
I don't get the catch message (if I change the name of the dll that is to be loaded, I do), so I'm guessing this is not the problem.Java Code:static { try { System.loadLibrary("beidlibjni"); } catch (UnsatisfiedLinkError e) { System.err.println("Native code library eidlib failed to load.\n" + e); System.exit(1); } }
However, further on in the code when a function of the dll is actually called, I get the error
man, this is bugging me!
- 05-28-2008, 04:19 PM #9
Member
- Join Date
- Apr 2008
- Posts
- 19
- Rep Power
- 0
okay, update: it just works on another PC!
no idea why, anyone any thoughts?
can't seem to find a difference in the system.getProperties();
- 05-29-2008, 03:27 AM #10
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Ok, if on one system it's working, are you sure that on the previous system has that dll in correct place.
- 05-29-2008, 08:08 AM #11
Member
- Join Date
- Apr 2008
- Posts
- 19
- Rep Power
- 0
yes, I checked everything.
In fact the dll's are copied when installing another application
It is very strange: as I said: the loadlibrary does not generate an error
I even tried to put in a not existing dll to see if it would go to the catch statement, and it does
- 05-29-2008, 09:04 AM #12
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Can't you try it without a static block?
Similar Threads
-
Help with debugger!!
By anatel24 in forum New To JavaReplies: 1Last Post: 04-07-2008, 03:01 AM -
How DataSource Concept works in Spring Framework
By Java Tip in forum Java TipReplies: 0Last Post: 04-01-2008, 10:40 AM -
How DataSource Concept works in Spring Framework
By JavaBean in forum Java TipReplies: 0Last Post: 09-28-2007, 12:58 PM -
Error during compiling
By boy22 in forum New To JavaReplies: 2Last Post: 08-03-2007, 02:42 AM -
JSwat Java Debugger 4.2
By levent in forum Java SoftwareReplies: 0Last Post: 05-19-2007, 08:14 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks