Problem with Windows build - freetype.dll: %1 is not a valid Win32 application

Mads Bondo Dydensborg mbd at
Mon Jan 19 08:39:12 UTC 2015

Hi there

As written about earlier, I have compiled OpenJDK on Windows 7 64 bit, using Visual Studio 2010 Express SP 1, under Cygwin. (eventually: make clean images). AFAIK, VS Express will only build a 32 bit image, and has done. A simple HelloWorld test seems to work. However, if I try to run anything graphical, I get a linker error regarding Freetype:

mbd at LT01666 ~/Compile/openjdk-8-src-b132-03_mar_2014/openjdk/build/windows-x86-normal-server-release/images/j2sdk-image/demo/jfc/FileChooserDemo
$ ../../../bin/java.exe -jar FileChooserDemo.jar
jan. 19, 2015 8:39:41 AM FileChooserDemo main
SEVERE: null
        at java.awt.EventQueue.invokeAndWait(
        at java.awt.EventQueue.invokeAndWait(
        at javax.swing.SwingUtilities.invokeAndWait(
        at FileChooserDemo.main(
Caused by: java.lang.UnsatisfiedLinkError: C:\apps\cygwin\home\mbd\Compile\openjdk-8-src-b132-03_mar_2014\openjdk\build\windows-x86-normal-server-release\images\j2sdk-image\jre\bin\freetype.dll: %1 is not a valid Win32 application
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
....(lots of FontManager => ClassLoader$NativeLibrary stuff).

I am a bit new to Windows, but checking the lib in question: 

mbd at LT01666 ~/Compile/openjdk-8-src-b132-03_mar_2014/openjdk/build/windows-x86-normal-server-release/images/j2sdk-image/jre/bin
$ file freetype.dll
freetype.dll: current ar archive

mbd at LT01666 ~/Compile/openjdk-8-src-b132-03_mar_2014/openjdk/build/windows-x86-normal-server-release/images/j2sdk-image/jre/bin
$ ldd freetype.dll
        ntdll.dll => /cygdrive/c/windows/SysWOW64/ntdll.dll (0x77e70000)
        kernel32.dll => /cygdrive/c/windows/syswow64/kernel32.dll (0x75900000)
        KERNELBASE.dll => /cygdrive/c/windows/syswow64/KERNELBASE.dll (0x75a10000)

I am not sure if it is 32 or 64 bit, really...

As part of the build process, I had to create a copy of freetype.dll.a - this was installed in the X86 part of the Windows Program Files directory - I assumed that it was 32 bit.

Any help/hints much appreciated.


Mads Bondo Dydensborg

More information about the build-dev mailing list