________________________________
From: Robert Patrick <[email protected]>
Sent: Tuesday, August 29, 2017 9:36 AM
To: Maven Users List
Subject: Re: dll hell

What exactly are you trying to do with this class?  This class appears to be an 
internal JDK implementation class related to the javax.imageio package.  I 
wrote a simple example yesterday with only JAVA_HOME defined and 
%JAVA_HOME%/bin in my path and the class loaded fine without me having to 
explicitly load the native library.  In fact, when I tried to load it 
explicitly, I got an error saying that the library had already been loaded...
MG>yes jpeg.dll seems to be loading properly as i dont get any of those messages

MG>my IIOMetadata metadata not being written into output jpeg by ImageWriter... 
the call is

MG>ImageWriter#write(javax.imageio.metadata.IIOMetadata, IIOImage, 
ImageWriteParam) MG>ImageWriter is public abstract class ImageWriter implements 
ImageTranscoder MG>i need a concrete class which extends ImageWriter which for 
jpeg type is com.sun.imageio.plugins.jpeg.JPEGImageWriter MG>so the good news 
is that jpeg.dll seems to found on the path or java.library.path and is loaded 
by JDK

MG>but native call 
com.sun.imageio.plugins.jpeg.JPEGImageWriter.initJPEGImageWriter()J
MG>produces UnsatisfiedLinkError MG>java -version
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

MG>im thinking of uninstalling and re-installing JDK to get fresh copy of 
JPEGImageWriter and fresh copy of jpeg.dll
MG>WDYT?


> On Aug 29, 2017, at 7:14 AM, Martin Gainty <[email protected]> wrote:
>
>
>
>
> ________________________________
> From: Robert Patrick <[email protected]>
> Sent: Monday, August 28, 2017 5:34 PM
> To: Maven Users List
> Subject: RE: dll hell
>
> Since you mentioned DLLs in the subject, I assume this is Windows.
>
> Is the %JAVA_HOME%/jre/bin directory (where jpeg.dll lives) in the PATH?
>
> MG>%JAVA_HOME%/jre/bin is on the path and %JAVA_HOME%/jre/bin on 
> java.library.path
> MG>
>                                        String mPath = 
> "C:\\Java\\JDK1.8\\jre\\bin";
>        String langKey = "java.library.path" ;
>        System.setProperty ( langKey, mPath );
> MG>verified by successful System.load("JDK1.8/jre/bin/jpeg.dll")
>
> MG>C:\MAVEN-~1\MA095B~1\APACHE~1>dir %JAVA_HOME%\jre\bin\jpeg.dll
> MG> Directory of C:\Java\jdk1.8\jre\bin
> MG>   05/03/2015  07:05 PM           185,768 jpeg.dll
>
> MG> /** Sets up per-writer native structure and returns a pointer to it. */
> MG>    private native long initJPEGImageWriter();
>
> MG>which causes:
> MG>Caused by: java.lang.UnsatisfiedLinkError: 
> JPEGImageWriter.initJPEGImageWriter()J
>
> MG>openjdk suggests re-making the jpeg.dll with USE_SYSTEM_JPEG=true directive
> MG>https://urldefense.proofpoint.com/v2/url?u=https-3A__marc.info_-3Fl-3Dopenjdk-2Ddistro-2Dpkg-2Ddev-26m-3D136573001932634-26w-3D2&d=DwIFAw&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=Ql5uwmbofQMW0iErugdCnFgO-CBGr_pt_OzwdxJosG0&m=VajCl24eKyVkpuuL2_5eMx4D_cDqnCwFGIiTFU_bVtM&s=inOW5Sns-TKwPr9vvINfZaWS-csOsVFRCMhhjgQVwZ8&e=
>
> MG>i read somewhere that JNIEXPORT needs to be declared for each function in 
> the C dll for jpeg.dll
> MG>At present i dont know how to to reverse engineer jpeg.dll to add 
> JNIEXPORT signature for these functions
>
> MG>Which option do you suggest?
> MG>Thanks Patrick
> MG>Martin-
>
> -----Original Message-----
> From: Martin Gainty [mailto:[email protected]]
> Sent: Monday, August 28, 2017 4:25 PM
> To: [email protected]
> Subject: dll hell
>
> attempting to call native long initJPEGImageWriter(); in JPEGImageWriter 
> ..when i call initJPEGImageWriter i get:
>
>
> java.lang.UnsatisfiedLinkError: JPEGImageWriter.initJPEGImageWriter()
>
>
> ive read System.loadLibrary("jpeg") in static initialiser is "supposed to 
> load" jpeg library:
>
>
> static {
>        java.security.AccessController.doPrivileged(
>            new java.security.PrivilegedAction<Void>()
>            {
>                public Void run() {
> System.loadLibrary("jpeg");
>                  } //end run
>          }); //end doPrivileged/PrivilegedAction } //end static
>
>
> is supposed to load library but
>
>
> when i call initJPEGImageWriter i get
>
>
> java.lang.UnsatisfiedLinkError: JPEGImageWriter.initJPEGImageWriter()
>
>
> advice appreciated
>
> Martin
> ______________________________________________
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to