The following has been tested with Wine 4.0 on Ubuntu 18.04. Wine has been backported pretty far, so make sure you visit WineHQ to get a recent distribution of it.
If you have problems getting proper exit codes from executing Windows programs, try this:
wineconsole cmd /C your-command
wineconsole --backend=curses
In wineconsole
do:
reg query "HKLM\System\CurrentControlSet\Control\Session Manager\Environment"
reg delete "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" \
/v JAVA_HOME /f
reg add "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" \
/v JAVA_HOME /t REG_SZ /d C:\jdk /f
This is also where you set the PATH
environment variable.
Or use regedit
.