Homebrew / homebrew-cask

🍻 A CLI workflow for the administration of macOS applications distributed as binaries
https://brew.sh
BSD 2-Clause "Simplified" License
20.88k stars 10.69k forks source link

Latest dbvisualizer (9.2.5) does not install properly #10199

Closed scottsuch closed 9 years ago

scottsuch commented 9 years ago

Downloading http://www.dbvis.com/product_download/dbvis-9.2.5/media/dbvis_macos_9_2_5_java7.dmg

This is the error spit out by the installer.

java.lang.NoClassDefFoundError: Could not initialize class com.install4j.runtime.installer.frontend.GUIHelper
    at com.install4j.runtime.installer.helper.InstallerUtil.reportException(Unknown Source)
    at com.install4j.runtime.installer.Installer.main(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
    at com.install4j.runtime.launcher.MacLauncher.main(Unknown Source)
vitorgalvao commented 9 years ago

I can’t reproduce the error. Seems like it might be something wrong with your java installation, and not related to homebrew-cask. Can you install it manually?

scottsuch commented 9 years ago

@vitorgalvao, I just rebooted and ran brew cask install --force dbvisualizer (after multiple previous tries) and it worked just fine. Thanks for investigating, this can be closed.

scottsuch commented 9 years ago

Just commenting here in case anyone searches with the same issue. I think what ultimately happened was I had java, java6, and java7 all installed via brew cask. Uninstalling all of these then running the dbvisuazlier install worked. I'm not sure why but I figured it was worth noting.

apolunin commented 9 years ago

Hi everyone. I'll describe my scenario of installing dbvisualizer via brew here just in case it will help somebody. Like @scottsuch I have java7 and java8 installed via brew cask and I experienced the exactly same problem. Manual installation of the downloaded *.dmg file worked fine, but installing it via brew cask failed. So what I did - I edited the cask and removed "-q" option in the java stub call inside preinstall. So instead of having this:

  preflight do
    system "#{staged_path}/DbVisualizer Installer.app/Contents/MacOS/JavaApplicationStub", '-q', '-dir', "#{staged_path}"
  end 

I put this (the difference is only in the absence of '-q' option):

  preflight do
    system "#{staged_path}/DbVisualizer Installer.app/Contents/MacOS/JavaApplicationStub", '-dir', "#{staged_path}"
  end 

This is somewhat ugly because it forced me to make some actions in the UI installer manually, but at least I was able to install dbvisualizer successfully via brew and all brew's housekeeping seemed to be done correctly (at least I was able to uninstall it later with 'brew cask uninstall dbvisualizer').

I'm not that familiar with install4j which is used under the hood to install dbvisualizer and with cask syntax, but I hope the described scenario will work as a starting point for experienced contributors to create usual seamless brew experience :)