Git Product home page Git Product logo

Comments (11)

gibfahn avatar gibfahn commented on May 14, 2024 5

Casks seem to be for the installation of large .app files which we aren't doing. I personally think that using brew is fine for this.

I agree with this, the cask docs say:

Homebrew-Cask extends Homebrew and brings its elegance, simplicity, and speed to the installation and management of GUI macOS applications such as Atom and Google Chrome.
Homebrew-Cask does one thing, does it well, and plays nice with others. Apps are moved to your /Applications folder in the same way as you would manually.

Basically Cask is for GUI things that need to go into /Applications, and homebrew is for command-line things that need to be in the path (they usually go into /usr/local/bin).

I've always found it odd that Oracle java is a cask (and that it goes into /Applications, unlike every other language I've ever installed, which are all installed with brew and go into /usr/local/bin (e.g. python, groovy, go, kotlin, scala, Node.js). Maybe it's because it has a GUI update manager, idk.

Being a cask instead of a normal brew package also has the disadvantage that there is no built-in way to upgrade your apps, for brew you have brew upgrade, for Casks you have to install a separate command-line tool (which is not officially supported etc.) to upgrade things.

from homebrew-openjdk.

gdams avatar gdams commented on May 14, 2024

Casks seem to be for the installation of large .app files which we aren't doing. I personally think that using brew is fine for this.

As for the question about merging into the main branch..... I'm open to this concept but I do like the way that with this current setup we can simply manage our own repo and cut releases immediately without having to get someone to manually merge our pull request into the main repo. I'd be happy to add a pull request and see how it goes down in the main repo though. I do personally feel that we should have JCK compliance on macOS before adding this to the main repo as well.

from homebrew-openjdk.

AlexanderWillner avatar AlexanderWillner commented on May 14, 2024

Given that Oracle Java is a cask my assumption is that OpenJDK should also be a cask. This will probably be discussed after creating a Homebrew Pull Request. Maintaining also an own Tap to update immediately w/o waiting for the pull request to be merged, might be another option.

Anyway, waiting for JCK compliance and offering a Tap in the mean time might be the safest option.

from homebrew-openjdk.

gdams avatar gdams commented on May 14, 2024

closing as using brew appears to be okay for now

from homebrew-openjdk.

moshen avatar moshen commented on May 14, 2024

While this is a little bit of issue necromancy, after checking out this Tap I think the best course would be to implement as Casks.

  • Casks aren't only for .apps, they are also for software that is installed globally or requires admin permissions to install
  • @gdams zulu and java (Now openjdk) are both Casks and both simply install into /Library/Java/JavaVirtualMachines/
  • Installing into /usr/local does not allow GUI apps to use the installed jvm (as far as I know)
  • @gibfahn , unlike linux (and other nixs) Mac Java installs in various JavaVirtualMachines folders are usable on the cli through the /usr/libexec/java_home utility, which also allows you to switch jvms
  • @gibfahn buo/brew-cask-upgrade is completely unnecessary, use either brew cask upgrade caskname or brew cask reinstall caskname

I would be happy to make a PR converting these to Casks.

Maybe it would be better just to contribute these to https://github.com/Homebrew/homebrew-cask-versions.

from homebrew-openjdk.

gdams avatar gdams commented on May 14, 2024

@moshen I've just started hacking together a basic cask file. I'll update the issue with progress

from homebrew-openjdk.

moshen avatar moshen commented on May 14, 2024

@gdams 👍 nice, seems like you basically want something like the openjdk one: https://github.com/Homebrew/homebrew-cask/blob/3ca5556706a8e08fca9ea35bc82e9645494ebb05/Casks/java.rb

from homebrew-openjdk.

gdams avatar gdams commented on May 14, 2024

nearly finished now, just getting the plist stuff done :)

from homebrew-openjdk.

gdams avatar gdams commented on May 14, 2024

Okay so this cask file seems to be passing all of the tests and installing Java in the correct location. I'm pretty happy with this other than the fact that I curl the Info.plist file in from a gist right now. We should probably move these Info.plist files to an internal repo somewhere. Also the generated Info.plist might need a few other bits being changed (see below)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>English</string>
	<key>CFBundleExecutable</key>
	<string>libjli.dylib</string>
	<key>CFBundleGetInfoString</key>
	<string>AdoptOpenJDK 1.8.0_172</string>
	<key>CFBundleIdentifier</key>
	<string>net.java.openjdk.1.8.0.jdk</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>7.0</string>
	<key>CFBundleName</key>
	<string>AdoptOpenJDK 1.8.0</string>
	<key>CFBundlePackageType</key>
	<string>BNDL</string>
	<key>CFBundleShortVersionString</key>
	<string>1.0</string>
	<key>CFBundleSignature</key>
	<string>????</string>
	<key>CFBundleVersion</key>
	<string>10.0.2</string>
	<key>JavaVM</key>
	<dict>
		<key>JVMCapabilities</key>
		<array>
			<string>CommandLine</string>
		</array>
		<key>JVMMinimumFrameworkVersion</key>
		<string>13.2.9</string>
		<key>JVMMinimumSystemVersion</key>
		<string>10.6.0</string>
		<key>JVMPlatformVersion</key>
		<string>1.8</string>
		<key>JVMVendor</key>
		<string>Oracle Corporation</string>
		<key>JVMVersion</key>
		<string>1.8.0_172</string>
	</dict>
</dict>
</plist>
cask 'adoptopenjdk8' do
  version '8u172-b11,1.8.0_172'
  sha256 'c271c5aeebfec5cd6f41c24092472a66fc55f893e3118e63f4c1ab1cb4446157'

  # github.com was verified as official when first introduced to the cask
  url "https://github.com/AdoptOpenJDK/openjdk8-releases/releases/download/jdk8u172-b11/OpenJDK8_x64_Mac_jdk#{version.before_comma}.tar.gz"
  appcast 'https://github.com/adoptopenjdk/openjdk8-releases/releases.atom'
  name 'AdoptOpenJDK8'
  homepage 'https://adoptopenjdk.net/'

  postflight do
    system_command '/bin/mv',
                   args: ['-f', '--', "/usr/local/Caskroom/adoptopenjdk8/#{version}/jdk#{version.before_comma}",
                          '/usr/local/Caskroom/adoptopenjdk8/']
    system_command '/bin/rm',
                   args: ['-rf', '--', "/usr/local/Caskroom/adoptopenjdk8/#{version}"]
    system_command '/bin/mkdir',
                   args: ['-p', '--', "/Library/Java/JavaVirtualMachines/adoptopenjdk-#{version.after_comma}.jdk/Contents/MacOS"],
                   sudo: true
    system_command '/bin/ln',
                   args: ['-s', '--', "/usr/local/Caskroom/adoptopenjdk8/jdk#{version.before_comma}",
                          "/Library/Java/JavaVirtualMachines/adoptopenjdk-#{version.after_comma}.jdk/Contents/Home"],
                   sudo: true
    system_command '/bin/ln',
                   args: ['-s', '--', "/usr/local/Caskroom/adoptopenjdk8/jdk#{version.before_comma}/jre/lib/jli/libjli.dylib",
                          "/Library/Java/JavaVirtualMachines/adoptopenjdk-#{version.after_comma}.jdk/Contents/MacOS/libjli.dylib"],
                   sudo: true
    system_command '/usr/bin/curl',
                   args: ['--output', "/Library/Java/JavaVirtualMachines/adoptopenjdk-#{version.after_comma}.jdk/Contents/Info.plist",
                          'https://gist.githubusercontent.com/chaines27/32810cdfddefeeb5965e2969eb709fb5/raw/5ae95952b91f879e849c2be8a3a90be2d54ea1ec/homebrew-openjdk-1.8-info.plist'],
                   sudo: true
    system_command '/usr/libexec/PlistBuddy',
                   args: ['-c', "Set :CFBundleGetInfoString AdoptOpenJDK #{version.after_comma}", "/Library/Java/JavaVirtualMachines/adoptopenjdk-#{version.after_comma}.jdk/Contents/Info.plist"],
                   sudo: true
  end

  uninstall_postflight do
    system_command '/bin/rm',
                   args: ['-rf', '--', "/usr/local/Caskroom/adoptopenjdk8/jdk#{version.before_comma}"]
    system_command '/bin/rm',
                   args: ['-rf', '--', "/Library/Java/JavaVirtualMachines/adoptopenjdk-#{version.after_comma}.jdk"],
                   sudo: true
  end
end

from homebrew-openjdk.

 avatar commented on May 14, 2024

hello i'd really appreciate brew install openjdk preferably with everything just magically working :)

from homebrew-openjdk.

gdams avatar gdams commented on May 14, 2024

here is the first PR for jdk11 Homebrew/homebrew-cask#52874

from homebrew-openjdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.