brew update-reset && brew update and retried my command.brew doctor, fixed as many issues as possible and retried my command.Cannot uninstall the java cask. I believe sudo is needed, but cannot run brew with sudo.
$ brew cask uninstall java
==> Uninstalling Cask java
==> Running uninstall process for java; your password may be necessary
==> Removing launchctl service com.oracle.java.Helper-Tool
==> Not privileged to remove service.
Error: Command failed to execute!
==> Failed command:
/bin/launchctl remove com.oracle.java.Helper-Tool
==> Standard Output of failed command:
==> Standard Error of failed command:
Not privileged to remove service.
==> Exit status of failed command:
#<Process::Status: pid 17509 exit 1>
Error: Uninstall incomplete.
--verbose --debug==> Uninstalling Cask java
==> Uninstalling Cask java
==> Un-installing artifacts
==> Determining which artifacts are present in Cask java
==> 4 artifact/s defined
#<Hbc::Artifact::Uninstall:0x007fb9361c0b00>
#<Hbc::Artifact::Pkg:0x007fb9361c0a38>
#<Hbc::Artifact::PostflightBlock:0x007fb9361c0970>
#<Hbc::Artifact::Zap:0x007fb9361c07e0>
==> Un-installing artifact of class Hbc::Artifact::Uninstall
==> Running uninstall process for java; your password may be necessary
==> Removing launchctl service com.oracle.java.Helper-Tool
==> Executing: ["/bin/launchctl", "list", "com.oracle.java.Helper-Tool"]
==> Executing: ["/bin/launchctl", "remove", "com.oracle.java.Helper-Tool"]
==> Not privileged to remove service.
Error: Command failed to execute!
==> Failed command:
/bin/launchctl remove com.oracle.java.Helper-Tool
==> Standard Output of failed command:
==> Standard Error of failed command:
Not privileged to remove service.
==> Exit status of failed command:
#<Process::Status: pid 20384 exit 1>
Error: Uninstall incomplete.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/uninstall.rb:12:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/abstract_command.rb:35:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:98:in `run_command'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:168:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:132:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:8:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:93:in `<main>'
Error: Kernel.exit
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:173:in `exit'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:173:in `rescue in run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:156:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:132:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:8:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:93:in `<main>'
brew cask doctor==> Homebrew-Cask Version
Homebrew-Cask 1.2.3-72-g4fb60d89
caskroom/homebrew-cask (git revision 09bbd; last commit 2017-06-29)
==> Homebrew-Cask Install Location
<NONE>
==> Homebrew-Cask Staging Location
/usr/local/Caskroom
==> Homebrew-Cask Cached Downloads
~/Library/Caches/Homebrew/Cask (11 files, 598.7MB)
==> Homebrew-Cask Taps:
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask (3651 casks)
==> Contents of $LOAD_PATH
/usr/local/Homebrew/Library/Homebrew/cask/lib
/usr/local/Homebrew/Library/Homebrew
/Library/Ruby/Site/2.0.0
/Library/Ruby/Site/2.0.0/x86_64-darwin16
/Library/Ruby/Site/2.0.0/universal-darwin16
/Library/Ruby/Site
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/x86_64-darwin16
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/universal-darwin16
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/x86_64-darwin16
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin16
==> Environment Variables
LANG="en_GB.UTF-8"
PATH="~/Library/Go/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/Homebrew/Library/Homebrew/shims/scm"
SHELL="/usr/local/bin/fish"
Please try:
sudo launchctl remove com.oracle.java.Helper-Tool
sudo launchctl remove com.oracle.java.Java-Updater
brew cask uninstall java
Same issue as https://github.com/caskroom/homebrew-cask/issues/35665
Awesome, thanks. This works.
Most helpful comment
Please try:
Same issue as https://github.com/caskroom/homebrew-cask/issues/35665