jlink cross-targeting

Alan Bateman Alan.Bateman at oracle.com
Thu Aug 25 06:46:52 UTC 2016

On 24/08/2016 21:53, Sander Mak wrote:

> :
> I thought I'd fire up a Windows VM, running on an OSX host. Downloaded the win32 jigsaw-ea build to the host, pointed host's jlink at the win32 jmods directory and created a runtime image targeting Windows. After moving this image from the host to the windows VM, running bin/java.exe resulted in:
> Z:\image>bin\java.exe
> Error: could not find java.dll
> Error: Could not find Java SE Runtime Environment.
> I verified that the java.dll mentioned is available in the image's lib directory.
> For good measure, I re-created the image on Windows itself using jlink from the same win32 jigsaw-ea build. This image worked flawlessly.
> Is this one of the 'rough' edges mentioned above I'm running into, or am I missing a trick to make the cross-targeting work on OSX with a win32 JDK?
Sadly, this is the main issue. No issue running the linker on OS X, 
Linux, or Solaris, and targeting one of the other two. Also no need with 
different architectures, say running jlink on linux-x64 and create a 
run-time image for linux-arm. Windows is the odd man out, you can't 
currently run the linker on a non-Windows platform and target Windows or 
run the linker on Windows and target non-Windows. The issue is mostly 
because the layout is slightly different on Windows and jlink doesn't 
handle this properly yet. The other rough edge that I was thinking about 
at the time was endian-ness where the `--endian` can probably go away 
(jlink shouldn't need the hint as a CLI option).


More information about the jigsaw-dev mailing list