Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Custom Package which Wraps a Windows Installed Package

40 views
Skip to first unread message

Fred Eisele

unread,
Apr 5, 2022, 6:25:15 PM4/5/22
to conda-forge
Specifically, I want a package that sets my conda environment to use the Oracle JDK.
I want something similar in result to the https://anaconda.org/conda-forge/openjdk but with the oracle JDK.

Generally, I want to construct a package which provides wrappers for objects installed on my machine. 

The problem is that these objects are licensed in a way that limits their distribution.

Fred Eisele

unread,
Apr 6, 2022, 10:44:43 AM4/6/22
to conda-forge
I found part of what I was looking for in https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#set-env-vars
```
conda env config vars set JAVA_HOME="C:\Program Files\Java\jdk1.8.0_211"
```
Now I need to find the best way to add a mklink (Windows) to add java and javac to CONDA_PREFIX.

Fred Eisele

unread,
Apr 6, 2022, 12:19:07 PM4/6/22
to conda-forge

I see that I may create scripts which are run upon activation / deactivation.

https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#saving-environment-variables

  set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_211
  mkdir "%CONDA_PREFIX%\bin\"

  mklink "%CONDA_PREFIX%\bin\java.exe" "%JAVA_HOME%\bin\java.exe"
  mklink "%CONDA_PREFIX%\bin\javac.exe" "%JAVA_HOME%\bin\javac.exe"

This does what I want but it seems excessive to do this every time.
Are there other events which trigger scripts besides 'activate' and 'deactivate'? 

Mervin Fansler

unread,
Apr 13, 2022, 6:54:20 PM4/13/22
to conda-forge
Packages that indicate use of external libraries are termed "dummy" packages. Conda Forge provides them for `mpich` (see docs). There is a StackOverflow example for a `clang` one. 
I'm really not sure you'd need to create links or manipulate environment variables - the point of the dummy build is to let the system/user-level variables pass through (let PATH do its job).

The key issue is that other packages will depend on `openjdk` explicitly, so you have to create a dummy `openjdk` package and just assume things are set correctly at the system-level. What might be nice would be to use an activate script in your dummy package to verify that the environment variables and executables you expect the system to provide are accessible.
Reply all
Reply to author
Forward
0 new messages