If I run java.exe to start up a program using JNI and I use LoadLibrary() to load up any VS2005 DLL such as msvcrt80d.dll then I get error r6034 complaining about how it is illegal to load DLLs directly. VS2005 seems to expect that I link against a manifest file. Since java.exe was not compiled against any manifest file this makes it impossible to load DLLs.
You can't load just any native library using loadLibrary
loadLibrary() is designed to load JNI libraries. If you want to access code in a native library such as the one you mention, you must write a native library (see the JNI tutorial) to act as a bridge between java and the native library
Ok, so I think Webstart is broken. Webstart won't unpack a DLL unload you loadLibrary() on it, and if you can't loadLibrary() a non-JNI DLL it makes it impossible to distribute VS2005-built applications which need to unpack MSVCRT80.DLL, its associated manifest files, etc.
Is there an explicit way to tell Webstart to unpack these resources?
Same problem , and my solution was to create a manifest file for java.exe. The process is very simple, create a c++ project using this libs, then build in vs2005, by default it will generate a manifest file with the name myProjectName.exe.intermediate.manifest and with this typical contents:
Is it possible to copy this manifest into the application directory instead of the java.exe directory? If I ship this manifest with my application it won't have java.exe in the same directory.
Hi,
I am run a c++ dll developed with Visual Studio 2005 with JNI interface with jdk1.6 beta2.0. I am having the following problems:
1. if i embed the manifest in my dll and run my java application, the application loads msvcr71.dll.
2. if i do not embed the manifest within my dll and do the stuff explained in this forum, like creating a java.exe.manifest, i get the R6034 error. I tried by creating a folder and copying the mscr80.dll, msvcp80.dll and msvcm80.dll into the folder, but still i get the R6034 error.
Please help me solve this problem. Any suggestions/info is greatly appreciated.
Thanks,
Krishna.
For those of you following the JNI Tutorial, or many of the other JNI resources, on Windows, you may be the "R6034" error if you include the "-MD" compiler flag. Taking this out results in a built dll and it runs without the "R6034". I'm not claiming to understand the situation enough to explain it but as part of my going through the JNI Tutorial, I found this works for me.
I have a similar problem with Webstart. I try to use Leadtools DLLs (third party graphics library) together with a Visual C++ 2005 Express wrapper DLL. To satisfy library dependecies I have use loadLibrary() to load msvcr80.dll first. Under Windows 2000 everything works fine. Under Windows XP I get the R6034 error message. I have sent an enquiry to Sun. I do not want to bother the user of Webstart with additional installation procedures in addition to installing JRE. Is there any solution for this problem?
I have no problem in use JNI with MS VS2005. It runs fine with JDK 1.1.x-1.6.x. I also developed JNI SDK for .NET 1.1/2.0. With it anybody can develop JNI modules in any .NET language. See
http://www.simtel.net/product.php[id]95126[SiteID]simtel.net
If you google "OOJNI" you will be able to download this product from other sites.
If you are not using /MD switch, then you are statically linking to the dependent libraries and hence there is no runtime dependency. Thus no manifest file. At least that is what I think. However, I've seen manifest file generating even with /MT switch and wonder what am I missing.
Krishna, I am having the same problem as yours. I have created a C++ dll using Visual studio 2005. I was trying to load the dll using JNI. The application crashes. JNI is unable to load the C++ dll buid with Visual studio 2005. I tried changing /MD to /MT, but could not resolve it. Can you please tell me how did u resolved your problem. Anybody please suggest/advice me ...... to resolve my problem ???