Search code examples
ubuntujava-8wine

cannot install JDK 8 on wine Ubuntu


Hi I cannot install JDK 8 on Wine Ubuntu, it gives me an error message with no explanation. I tried to follow the following instructions but it also doesn't work... https://appdb.winehq.org/objectManager.php?sClass=version&iId=31528&iTestingId=90897

Anibody can help?

Thanks


Solution

  • I think we use the same broker (Directa?), and had the same issue.

    This is how i made Oracle Java 8 work on Wine on Xubuntu 16.10 and also able to run JNLP (Java Web Start) applications from Firefox for Windows, I hope following these passages will solve your problem too.

    I used PlayOnLinux, the Wine graphical front-end, but probably this will work also straight on Wine paths; maybe you can try using PlayOnLinux if working on Wine wasn't successfull.

    • if you haven't done already, install PlayOnLinux from Ubuntu "Software" package manager;
    • from PlayOnLinux, click on "Install a program" and search for "Firefox" then press Install: a wizard will guide you to the proper installation of Firefox (it will offer you to download the Firefox Windows installer, or you can point to a previuosly downloaded one);
    • download from java.com the latest version of the JDK (not JRE!) for Windows, current link. I choosed the Windows x86 version (I am on a 32bit machine), filename jdk-8u121-windows-i586.exe for JDK version 8.121;
    • this part of the procedure is taken from the WineHQ page you mentioned: move the JDK installation package on the C: emulated path that PlayOnLinux created for Firefox:

      /home/[linux username]/PlayOnLinux's virtual drives/MozillaFirefox/drive_c/
      
    • navigate to that path and execute from the shell:

      $ 7z x jdk-8u121-windows-i586.exe
      

      (of course change the file name in case of different JDK version): this will create a tools.zip file in the same path;

    • create a jdk subfolder and navigate into it, then unzip the tools.zip file:

      $ mkdir jdk
      $ cd jdk
      $ unzip ../tools.zip
      
    • for the next step, you have to run unpack200: you can get this JAR unpacker from another Oracle JDK or JRE linux installation (you find it in bin folder); if you don't have one available, you can install the Oracle JDK for linux on your machine so you will have the unpack200 executable ready to use, for this you can follow this procedure;

    • execute these shell commands to unpack the JDK JARs:

      $ find -type f | grep '\.pack$' | while read __line; do \
      __outjar="$(dirname "$__line")/$(basename "$__line" .pack).jar"
      echo "$__line" -- "$__outjar"; \
      unpack200 "$__line" "$__outjar"; \
      done
      
    • Now the Oracle JDK is ready to use, test if it's working under Wine with this shell command: wine bin/java -version it should answer with the Java version and Runtime Environment statements; normal Java applications can then be run using the executables under the /jdk/bin path;

    • in order to be able to execute the JNLP files, all you have to do is to download the desired JNLP in Firefox for Windows and choose "Open with..." then point to the Java Web Start executable, that is located in the C: emulated path under jdk/bin/javaws.exe.

      Its complete path would then be:

      /home/[linux username]/PlayOnLinux's virtual drives/MozillaFirefox/drive_c/jdk/bin/javaws.exe
      

      In this way all JNLP files open in the browser will be open with the JWS machine.

    This is enough to install Oracle Java 8 under Wine and run the Java/JNLP applications just fine.

    I had a second issue with the firewall in order to get the price stream working on the broker application, but this is not in the topic of this answer.

    I hope this helps. If you find any problem in any of these steps let me know.