How can I treat a dependency as resolved? #174
Replies: 4 comments 5 replies
-
You can't, brew will install the dependencies it needs. Trying to get around that is just asking for trouble. If you want to use a different java to run your tools you can just use the |
Beta Was this translation helpful? Give feedback.
-
One way to avoid installing Homebrew openjdk as a dependency is for you to maintain your own tap with modified formulae that don't declare openjdk as a dependency. You may need to make further modifications to the formulae to make sure it can find your local JDK if it needs to. It may not feel like the most convenient solution, but it's there if you really need it. |
Beta Was this translation helpful? Give feedback.
-
@SMillerDev @carlocab Thank you both for your swift response. @carlocab Thanks for the explanation. Thanks for caring |
Beta Was this translation helpful? Give feedback.
-
See https://docs.brew.sh/Building-Against-Non-Homebrew-Dependencies for some instructions and a history of why this is the case. |
Beta Was this translation helpful? Give feedback.
-
I am on MacOS and have my JDK set up (which is not
openjdk
) and would like to use it instead ofopenjdk
.To avoid side effects I would like
brew
to treat theopenjdk
dependency as resolved so that it does not try to installopenjdk
whenever I addmaven
orgradle
or anything else requiringopenjdk
.I would prefer something "permanent" since I'm pretty sure I would forget about a command line option latest after the next vacation...
Trying to be clever I tried
brew pin openjdk
but since it is not installed I get an error mentioning exactly that.Can it be done?
Beta Was this translation helpful? Give feedback.
All reactions