Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test installation und use under Windows #171

Open
johann-petrak opened this issue Jun 21, 2022 · 8 comments
Open

Test installation und use under Windows #171

johann-petrak opened this issue Jun 21, 2022 · 8 comments

Comments

@johann-petrak
Copy link
Collaborator

There are many different ways for how to install Python and python packages under Windows and then use the packages for development.
Also a range of options for installing Java under Windows. Try out some of them and come up with a recommended way to do this.

@johann-petrak
Copy link
Collaborator Author

johann-petrak commented Jun 21, 2022

First approach:

  • install miniconda: download from https://docs.conda.io/en/latest/miniconda.html Windows 64 bit and install:
    • install for Just Me (recommended), default location
    • do NOT add miniconda to the PATH (default)
    • Register Miniconda as default Python (default)
    • this makes available: Anaconda Powershell Prompt and Anaconda Prompt
  • create conda environment:
    • conda create -y -n gatenlp python=3.9
    • conda activate gatenlp
    • python -m pip install gatenlp[all,notebook]
  • after this the environment can be used in both the Anaconda Powershell and the Anaconda command prompt
    • however, the python or conda commands are not available in the normal command prompt
    • the Anaconda powershell can do command completion for the installed gatenlp-gate-worker.exe program, the Anaconda command prompt cannot, but finds it when entered
  • install GATE: https://gate.ac.uk/download/#latest
    • use platform-specific installer for Windows
    • run it: prompts for downloading JDK
    • click OK - shows the adoptopenjdk.net page
    • shows OpenJDK 11 / Hotspot preselected
    • NOTE: shows that the page has moved to adoptium.net
      • on that page version 11 is preselected
      • download JDK .msi for x64
    • install Eclipse Temorin JDK Hotspot, 11.0.15 with default options
    • now restart GATE installation: prompts for java again: ?????
    • could not find any entry in the start menu either
    • however the command "java" is known in the command prompt
    • retrying: run the gate installer exe from within the command prompt that knows java: still getting prompted for a java!
    • cannot find any new entry in the start menu, but when I re-run the Java installer it shows that it is already installed
    • ok, modify the installation and enable "JavaSoft (Oracle) registry keys"
    • GATE installer now works
      • remember (default) installation path for later: C:\Program Files\GATE_Developer_9.0.1
  • after installing java, the java command is avilable in the default command prompt
    • also avialble in the Anaconda powershell and command terminals!

Test in one of the Anaconda Terminals:

  • run gatenlp-gate-worker.exe : requires the --gatehome parameter or environment variable GATE_HOME to be set
  • when running with --gatehome:
    • gatenlp-gate-worker.exe --gatehome "C:\Program Files\GATE_Developer_9.0.1" - starting the worker on the Java side seems to work
    • connecting a Python GateWorker to the process using start=False and the auth token also works
    • creating GATE document from Python works

OK, to test current release, installed git, and cloned the repo. Then

  • python -m pip install -U -e .[alldev]
  • installed spacy and stanza models
  • Right click windows start icon - System - scroll down to Related settings, click Advanced system settings - Environment Variables
    • need to use new command terminal!
  • all tests pass!

@ianroberts
Copy link
Member

  • now restart GATE installation: prompts for java again: ?????

The exe installer (as well as the gate.exe launcher) chooses a JVM by looking in the registry, in order for a non-Oracle Java to work you need to select a non-default option in the AdoptOpenJDK installer to set registry keys compatible with Oracle Java. This is spelled out on the GATE download page

The AdoptOpenJDK website provides packages for various operating systems, and is particularly suitable for Windows users - ensure you enable the "JavaSoft (Oracle) registry keys" option in the installer, otherwise gate.exe will not work

but I guess it's not clear here that the same applies to the installer exe as to gate.exe.

@ianroberts
Copy link
Member

ianroberts commented Jun 21, 2022

It may be that this option only exists in AdoptOpenJDK 8, not later versions - this is the information that was current when the GATE 9.0.1 installer was generated.

@ianroberts
Copy link
Member

Alternative might be Zulu JDK (the one that GATE recommends for Apple Silicon Macs) which definitely does install the Oracle-compatibility registry keys.

@johann-petrak
Copy link
Collaborator Author

Thanks Ian - I think I stumbled over this already once in the past - I am notoriously bad at reading the fine print and just expect things to just work with the default options :)
Just out of curiosity - why can't the GATE installer not also check for the location of the java command on the PATH (which apparently it is as i can run "java" from inside all the command terminals I have), at least as a fall-back option?

@ianroberts
Copy link
Member

The behaviour for how to find Java is set by Launch4J (the tool that generates the .exe), if we wanted to override that we'd need to use a different exe wrapper tool. Or if the adoptium/zulu/whatever installer associates its own javaw as the handler for .jar files then you could just use the .jar installer for GATE instead of the exe one.

Though then you'd also have to launch GATE by double clicking on gateLauncher.jar rather than gate.exe.

@ianroberts
Copy link
Member

Does the adoptium/temurin installer for 11 still have the option to add JavaSoft registry keys? If not maybe we should switch the recommendation on the GATE download page to Zulu across the board, which definitely does have that (though still as a non-default option).

@johann-petrak
Copy link
Collaborator Author

Yes, I just failed to initially activate it (the default is not to activate it).
However, one can run the installation program after the initial installation, choose to modify an existing installation and just select that option. After this, the GATE installer works fine. This is what I ended up doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants