[Wine] Java on host and wineprefix questions

Martin Gregorie martin at gregorie.org
Fri Feb 14 02:53:40 CST 2014

On Thu, 2014-02-13 at 18:04 +0200, Raif S. Berent wrote:
> Is it possible to use java from host from within wine? The obvious
> answer is no - must install the windows version. However, I am
> wondering whether a symlink to the hos java folder (or similar trick)
> would work, considering that jva is a VM. I mean, does java really
> care what environment the request came from?
That depends on whether the application is calling native code, i.e.
code accessed via JNI. Obviously native code modules are not written to
be OS-independent. You might get lucky, but I wouldn't hold my breath
because much JNI code is written to access ABIs or libraries (DLLs) that
the JVM doesn't allow access to. 

100% Java applications should work under any JRE because thats the WORA
promise. I use one or two graphical Java apps under Linux that were
almost certainly designed to work on a Windows box judging by the targer
audience. They work really well. Bottom line: if you know that the
application is 100% Java, why bother with WINE at all? If you know its
not, then using the Windows JRE is almost certainly necessary. If it
depends on BAT or CMD files to launch, you should be able to rewrite
them as bash scripts.

However, if the app uses JNI modules can you be certain that they are
either entirely self-contained or only call WINE-supported ABIs?

Don't forget that there are half-way houses too: 100% Java client
applications that talk to local Windows-only servers, e.g. a DBMS with
no Linux port. In that case you might run the server under WINE but use
the Linux JRE for the client.
> Second question is re WINEPREFIX, and whether such a setup is
> possible: Let's assume I have dotnet40 and all dependents installed in
> .wine-dotnet. Let's then try to install some dotnet dependent software
> in a separate prefix so as not to contaminate our working dotnet pool.
> Set the prefix as .wine-someapps and link the dotnet dependencies to
> the first prefix, install as normal - any additions go into the second
> prefix.
Probably not. There's only one $WINEPREFIX per user logon and no defined
way to communicate between different copies of the directories that
$WINEPREFIX names unless you want to risk using symlinks to break the
WINE-imposed isolation. 

There's no problem in having several separate directories pointed to by
$WINEPREFIX in the same user. I do it all the time. You only need a 3 or
4 line bash script to set $WINEPREFIX to point to the setup you want to
run and then run wine. I have the impression that the more recent WINE
releases are expecting a Linux box to have multiple WINE apps installed
in separate prefixes because they seem to share more WINE code between


More information about the wine-users mailing list