Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-22-2008, 01:04 PM
Member
 
Join Date: Apr 2008
Posts: 12
Fleur is on a distinguished road
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:
Quote:
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)
The 2 jar files are copied into a lib subdirectory.

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.

Quote:
java -jar "eid.jar" -Djava.library.path="lib"
did not help either

Can anyone point me in the right direction?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-22-2008, 01:14 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,376
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
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.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-22-2008, 01:22 PM
Member
 
Join Date: Apr 2008
Posts: 12
Fleur is on a distinguished road
hi,

projectfolder
\_build
\_dist
---\_lib

\_nbproject
\_src
\_test

nothing else
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 05-22-2008, 01:38 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,376
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
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?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 05-22-2008, 07:12 PM
Member
 
Join Date: Apr 2008
Posts: 12
Fleur is on a distinguished road
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:
Code:
System.loadLibrary("my.dll");
Nothing works...

Very strange since things just work inside netbeans...
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 05-23-2008, 12:12 AM
danielstoner's Avatar
Senior Member
 
Join Date: Apr 2008
Location: Canada
Posts: 191
danielstoner is on a distinguished road
Probably you should specify a class path when you try to run?
__________________
Daniel @ [
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
]
Language is froth on the surface of thought
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 05-23-2008, 06:02 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,376
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
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.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 05-28-2008, 03:19 PM
Member
 
Join Date: Apr 2008
Posts: 12
Fleur is on a distinguished road
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:

Code:
static { try { System.loadLibrary("beidlibjni"); } catch (UnsatisfiedLinkError e) { System.err.println("Native code library eidlib failed to load.\n" + e); System.exit(1); } }
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.
However, further on in the code when a function of the dll is actually called, I get the error
man, this is bugging me!
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 05-28-2008, 06:19 PM
Member
 
Join Date: Apr 2008
Posts: 12
Fleur is on a distinguished road
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();
Bookmark Post in Technorati
Reply With Quote
  #10 (permalink)  
Old 05-29-2008, 05:27 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,376
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Ok, if on one system it's working, are you sure that on the previous system has that dll in correct place.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #11 (permalink)  
Old 05-29-2008, 10:08 AM
Member
 
Join Date: Apr 2008
Posts: 12
Fleur is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
  #12 (permalink)  
Old 05-29-2008, 11:04 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,376
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Can't you try it without a static block?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with debugger!! anatel24 New To Java 1 04-07-2008 05:01 AM
How DataSource Concept works in Spring Framework Java Tip Java Tips 0 04-01-2008 12:40 PM
How DataSource Concept works in Spring Framework JavaBean Java Tips 0 09-28-2007 02:58 PM
Error during compiling boy22 New To Java 2 08-03-2007 04:42 AM
JSwat Java Debugger 4.2 levent Java Announcements 0 05-19-2007 10:14 AM


All times are GMT +3. The time now is 08:45 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org