On Windows, it seems that Maven puts its .m2 folder into %USERPROFILE%\.m2 by default, whereas the default location for .jgo is %HOME%\.jgo.
This can be problematic in cases where %HOME% points to e.g. a network drive location (as required for environments using shared desktops across the machines of an organization). If that is different from %USERPROFILE% (which usually points to C:\Users\<username>), errors such as the one below can occur when using jgo via pyimagej in a Jupyter notebook:
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'H:\\.m2\\repository\\com\\headius\\invokebinder\\1.2\\invokebinder-1.2.jar' -> 'H:\\.jgo\\net\\imglib\\imglib2-imglyb\\0.3.0+net.imagej-imagej-RELEASE+net.imglib-imglib2-imglyb-0.3.0+net.imglib-imglib2-imglyb-0.3.0\\invokebinder-1.2.jar'
@ctrueden can we change the default location of .jgo to %USERPROFILE%\.jgo as well? If not, we should at least fix the lookup for .m2 here:
On Windows, it seems that Maven puts its
.m2
folder into%USERPROFILE%\.m2
by default, whereas the default location for.jgo
is%HOME%\.jgo
.This can be problematic in cases where
%HOME%
points to e.g. a network drive location (as required for environments using shared desktops across the machines of an organization). If that is different from%USERPROFILE%
(which usually points toC:\Users\<username>
), errors such as the one below can occur when usingjgo
viapyimagej
in a Jupyter notebook:@ctrueden can we change the default location of
.jgo
to%USERPROFILE%\.jgo
as well? If not, we should at least fix the lookup for.m2
here:https://github.com/scijava/jgo/blob/20553f3f63c8161ce8b1ebaa488fa469449cc32e/jgo.sh#L79-L81
and change this:
https://github.com/scijava/jgo/blob/f1037d7d6cf9a1596d669c5c0d2e3e9d7853500d/jgo/jgo.py#L169-L170
to something like this:
A workaround would likely be to define an
M2_HOME
environment variable, right?