Skip to content

Add Windows documentation#520

Closed
don-vip wants to merge 1 commit into
AdoptOpenJDK:masterfrom
don-vip:doc-windows
Closed

Add Windows documentation#520
don-vip wants to merge 1 commit into
AdoptOpenJDK:masterfrom
don-vip:doc-windows

Conversation

@don-vip

@don-vip don-vip commented Nov 19, 2019

Copy link
Copy Markdown
Contributor

As requested here: #392 (comment)

@karianna karianna added the enhancement New feature or request label Nov 19, 2019
@karianna karianna added this to the 2.0.x milestone Nov 19, 2019
Comment thread INSTALL_WINDOWS.md
1. Install [Visual C++ Build Tools](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16): select MSVC Build Tools + Windows 10 SDK
2. Install [WIX](https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311.exe)
3. Copy [wixgen.jar](https://github.com/akashche/wixgen/releases/download/1.7/wixgen.jar) to `C:\msi-deps`
4. Copy all 65 files from `C:\Program Files (x86)\WiX Toolset v3.11\bin` to `C:\msi-deps\wix311-binaries`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hsould not be necessary... If so... why so?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is necessary. I don't know why, I have zero knowledge in the rust/cargo stuff but if you don't do this, the build fails as follows:

/cygdrive/c/git/IcedTea-Web/launchers
+ mv C:/git/IcedTea-Web/launchers/target/images/icedtea-web C:/git/IcedTea-Web/launchers/target/images/icedtea-web-2.0.0-win.bin
+ isWindows
++ uname
+ [[ CYGWIN_NT-10.0 == *\N\T* ]]
+ return 0
+ which cargo
/cygdrive/c/Users/vippy/.cargo/bin/cargo
+ '[' '!' xC:/msi-deps/wixgen.jar = x -a '!' x/cygdrive/c/msi-deps/wix311-binaries/ = x ']'
+ splitVersion 2.0.0
+ PACKAGE_VERSION=2.0.0
++ echo 2.0.0
++ cut -d. -f 1
+ MAJOR_VERSION=2
++ echo 2.0.0
++ cut -d. -f 2
+ MINOR_VERSION=0
++ echo 2.0.0
++ cut -d. -f 3
++ sed 's/[^0-9]*//g'
+ MICRO_VERSION=0
+ sed -e 's|../win-installer|C:/git/IcedTea-Web/launchers/win-installer|g' -e 's|[@]PACKAGE_VERSION[@]|2.0.0|g' -e 's|[@]MAJOR_VERSION[@]|2|g' -e 's|[@]MINOR_VERSION[@]|0|g' -e 's|[@]MICRO_VERSION[@]|0|g' -e 's/[@]PACKAGE_VERSION[@]/2.0.0/g' C:/git/IcedTea-Web/launchers/win-installer/installer.json.in
++ imageName win.bin
++ echo icedtea-web-2.0.0-win.bin
+ /cygdrive/c/Java/AdoptOpenJDK/jdk-13.0.0.33-hotspot/bin/java -jar C:/msi-deps/wixgen.jar C:/git/IcedTea-Web/launchers/target/images/icedtea-web-2.0.0-win.bin -c C:/git/IcedTea-Web/launchers/target/tmp/itw-installer.json -o C:/git/IcedTea-Web/launchers/target/tmp/itw-installer.wxs
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector (file:/C:/msi-deps/wixgen.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of com.sun.xml.bind.v2.runtime.reflect.opt.Injector
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
+ pushd C:/git/IcedTea-Web/launchers/target/tmp
/cygdrive/c/git/IcedTea-Web/launchers/target/tmp /cygdrive/c/git/IcedTea-Web/launchers
+ /cygdrive/c/msi-deps/wix311-binaries//candle.exe /nologo itw-installer.wxs
./build.sh: ligne 117: /cygdrive/c/msi-deps/wix311-binaries//candle.exe: No such file or directory

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error message can be circumvented by setting the WIX_TOOLSET_DIR variable, which is otherwise by default set to /cygdrive/c/msi-deps/wix311-binaries/ here. The default value may be outdated or just plain wrong.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AurumTheEnd @judovana How can we solve this issue? Just remove the line? Add an info about the correct value of the env variable?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just removing the line wouldn't help anyone. As the WIX_TOOLSET_DIR is supposed to be the intended way and just isn't clearly marked anywhere right now – your documentation should do that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@don-vip can you take care of that change?

Comment thread INSTALL_WINDOWS.md Outdated
Comment thread INSTALL_WINDOWS.md Outdated

# Build using Cygwin64 terminal

6. `export JRE=/cygdrive/c/Java/AdoptOpenJDK/jdk-13.0.0.33-hotspot`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jdk13/11/8 ?? Not sure what is now most supported JDK for itw. Maybe the version oculd be wildchar, but I do not insists.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was just an example. The proper way would be to not force users to define a "JRE" variable at all, and either rely on JAVA_HOME, or simply on the PATH. I can remove the version number.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't set the variable you get the following error:

$ ./build.sh 2.0.0
+ set -e
+ set -o pipefail
+ SCRIPT_SOURCE=./build.sh
+ '[' -h ./build.sh ']'
+ isWindows
++ uname
+ [[ CYGWIN_NT-10.0 == *\N\T* ]]
+ return 0
++++ dirname ./build.sh
+++ cd -P .
+++ pwd
++ cygpath -m /cygdrive/c/git/IcedTea-Web/launchers
+ readonly SCRIPT_DIR=C:/git/IcedTea-Web/launchers
+ SCRIPT_DIR=C:/git/IcedTea-Web/launchers
+ source C:/git/IcedTea-Web/launchers/configure.sh
++ VERSION=2.0.0
++ LOCALIZATIONS='en_US.UTF-8 cs_CZ.UTF-8 pl_PL.UTF-8 de_DE.UTF-8'
++ '[' x2.0.0 == x ']'
++ readonly VERSION=2.0.0
++ VERSION=2.0.0
++ '[' x == x ']'
++ echo 'default jre is necessary'
default jre is necessary
++ exit 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@don-vip correctly says that you need to set the JRE variable in order to build. Maybe it can be replaced in this documentation by something like export JRE=path to JRE on your system, so that it is not version specific.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@don-vip can you take care of that change?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about defaulting to JAVA_HOME if JRE is not defined ?

@judovana

Copy link
Copy Markdown
Contributor

Otherwise it is great. thank ou very much fot hte PR!!!!

@hendrikebbers

Copy link
Copy Markdown
Contributor

@judovana can we merge this PR?

@patris70

Copy link
Copy Markdown

Hi Team,

any news. I have always error with last Icedtea-Web 2.0 compiling.

Regards

@sclassen

Copy link
Copy Markdown
Contributor

@patris70
Are those errors related to this PR? If not can you please open an issue.
Otherwise give more details on how your build is failing

@patris70

Copy link
Copy Markdown

@sclassen,
Please see my commented on Nov 7, 2019 in #392.

@Jamila891 Jamila891 added the Native build All issues that are targeting the native build (installers & executables) label Sep 21, 2020
@patris70

patris70 commented Sep 24, 2020

Copy link
Copy Markdown

@hendrikebbers
Hi, here is Info for Compiling Tools on Windows, you can using for Windows Build Document.

First, we need itw_win_devkit, here is link (we do not need MS VS or other), as Info you can using this Tools for Icedtea-Web 1.8.x compiling:
https://github.com/akashche/itw_win_devkit

Download MAVEN from here:
https://maven.apache.org/download.cgi

Download GIT from here:
https://git-scm.com/downloads

We need WINGEN.JAR File, copy this file in wix\bin Folder, here ist File:

wixgen.zip

For building Javaws.exe x64 (64bit), we need JDK x64, for Javaws.exe x86 (32bit), we need JDK x86 (This Trick works just for Icedtea-Web 1.8.x Version).

For Icedtea-Web 2.0 Version, you need just this trick for Javaws.exe x86 building (your msi-installer suggests "Program Files" instead of "Program Files (x86)" as the installation directory for your 32-bit build on a 64-bit Windows and if you follow the suggestion you will have 32-bit launcher in the 64-bit programs directory),
in .cargo folder create config file with this content (i used itw-dev kit):
target = "i686-pc-windows-gnu"

8

9

10

Add in Windows %PATH%, ==> C:\maven\bin;c:\git\cmd;c:\64bit\wix\bin

Create this Variables with Value:
MAVEN_HOME=C:\maven
M2_HOME=C:\maven
WIX_TOOLSET_DIR=C:\64bit\wix\bin
WIXGEN_JAR=C:\64bit\wix\bin\wixgen.jar

For example, my Source files and Tools are in Folder C:\64bit and Icedtea-Web Source Folder Name is icedtea-web-2, create a Batch file with this content:

@echo off
set BAD_SLASH_SCRIPT_DIR=%~dp0
set SCRIPT_DIR=%BAD_SLASH_SCRIPT_DIR:=/%
set PATH=%PATH%;%SCRIPT_DIR%tortoisehg
set PATH=%PATH%;%SCRIPT_DIR%jdk/bin
set PATH=%PATH%;%SCRIPT_DIR%git/cmd
set PATH=%PATH%;%SCRIPT_DIR%cygwin/bin
set PATH=%PATH%;%SCRIPT_DIR%cygwin
set PATH=%PATH%;%SCRIPT_DIR%rust/bin
set JRE=C:\64bit\jdk
set JRE_Home=C:\64bit\jdk
set Java_Home=C:\64bit\jdk

Run your Batch File, then start cygwin.bat File.
Run this two commands:
PATH=/usr/bin:$PATH
export JRE=/cygdrive/c/64bit/jdk

Now Run this Command:
mvn clean install -DskipTests -P launchers

Now you compiled withot Error and MSI File is in Path C:\64bit\icedtea-web-2\launchers\target\images:

3

4

Hope to help other

@sclassen sclassen closed this Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Native build All issues that are targeting the native build (installers & executables)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants