0

I am running java desktop application which is coded in java 1.4 version. i am using eclipe as my ide and trying to run that application in java 1.6 version in that project they use jcom jar file to export data to excel sheet. while i trying to click on excel button in desktop application . That functionality is not working and throwing below exception.but i build path properly in my project explorer jcom jar is present in referenced libraries. can any one plz help me to sort out this exception. thanks in advance.

Exception in thread "AWT-EventQueue-1" java.lang.UnsatisfiedLinkError: no jcom in java.library.path at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) at jcom.IDispatch.(IDispatch.java:287) at .StockManager.BusinessSheets.exportToExcel(BusinessSheets.java:2302) at .StockManager.BusinessSheets$BusinessSheetPanel$3.mouseClicked(BusinessSheets.java:439) at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$000(Unknown Source) at java.awt.EventQueue$1.run(Unknown Source) at java.awt.EventQueue$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source) at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$2.run(Unknown Source) at java.awt.EventQueue$2.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at .StockManager.WaitCursorEventQueue.dispatchEvent(WaitCursorEventQueue.java:23) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)

bhuvanpavan
  • 229
  • 1
  • 5
  • 16

2 Answers2

3

case 1: jcom.dll is not in path.

solution: put the jcom.dll in C:/Windows/System32

case 2: jcom.dll is used by someother process

solution: try to find that process and kill it.

Rajesh Pitty
  • 2,823
  • 2
  • 18
  • 28
  • thanks but i got version problem.i found jcom.dll file and place that in /sys32 as u said in case 1. but i got versioning problem states that Exception in thread "AWT-EventQueue-1" java.lang.UnsatisfiedLinkError: C:\Windows\System32\jcom.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform at java.lang.ClassLoader$NativeLibrary.load(Native Method). i dont have proper resources . i mean i jcom.dll 64-bit. do u have any idea where can i get that jcom.dll 64-bit one??? – bhuvanpavan Jun 08 '12 at 10:28
  • sorry i have no idea. i guess they did not develop for 64 bit. i guess this link may help you. http://stackoverflow.com/questions/3439845/register-32-bit-com-dll-to-64-bit-windows-7 – Rajesh Pitty Jun 08 '12 at 10:43
  • or you could try placing the jcom.dll inside JAVA_PATH/bin – Rajesh Pitty Jun 08 '12 at 10:55
  • this is a old real time desktop application project. now working fine in windows nt . my task is to run that project with new java version 1.6 .i am copying required files from the windows nt. i copied jcom.dll file from windows nt to my system and placed as u said.then i got above new exception. is there any way to solve this ??? – bhuvanpavan Jun 08 '12 at 11:13
  • i could only suggest you to download the source files from here http://sourceforge.net/projects/jcom/files/JCom-stable/jcom-2.2.4/ and try compile and create jcom.dll for 64 bit(that i don't have an idea how to do) – Rajesh Pitty Jun 08 '12 at 11:44
0

The java.library.path is using for JNI shared libraries such as DLLs or .so files. It appears your jcom.jar (which you can see is being loaded on the third line of the stack so it finds the JAR) needs a jcom.dll. On windows, this has to be in your PATH or java.library.path

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130