Closed karianna closed 5 years ago
(I've entered the very same comment in the referenced thread. Copied here for convenience.)
I don't know if I point out something everybody already knows, but anyway...
When I build the JDK on my Mac, make images builds the requisite MacOS-friendly directory tree under build/macosx-x86_64-normal-server-release/images/jdk-bundle/jdk-11.jdk/
, in addition to the "standard linux tree" under build/macosx-x86_64-normal-server-release/images/jdk/
:
$ tree -L 3 build/macosx-x86_64-normal-server-release/images/jdk-bundle/jdk-11.jdk
build/macosx-x86_64-normal-server-release/images/jdk-bundle/jdk-11.jdk
└── Contents
├── Home
│ ├── bin
│ ├── conf
│ ├── demo
│ ├── include
│ ├── jmods
│ ├── legal
│ ├── lib
│ ├── man
│ └── release
├── Info.plist
└── MacOS
└── libjli.dylib -> ../Home/lib/jli/libjli.dylib
$ tree -L 1 build/macosx-x86_64-normal-server-release/images/jdk
build/macosx-x86_64-normal-server-release/images/jdk
├── bin
├── conf
├── demo
├── include
├── jmods
├── legal
├── lib
├── man
└── release
So it seems to that a "correct" MacOS installation archive could be created by simply selecting the jdk-bundle
sub-directory when creating it.
A trivial command example which builds an unsigned PKG installer from the jdk-bundle
:
$ pkgbuild --root build/macosx-x86_64-normal-server-release/images/jdk-bundle/jdk-11.jdk --install-location /Library/Java/JavaVirtualMachines/jdk-11.jdk --identifier net.adoptopenjdk.openjdk --version 11.0.0 build/macosx-x86_64-normal-server-release/OpenJDK-11.pkg
A 'real' pkg should of course be correctly signed, probably have another identifier, etc etc.
@lenborje this looks really interesting, let's try and jump on a call sometime and investigate this further.
Is there any progress on this? I would like to transition to AdoptOpenJDK for my Development needs since coming 25th will be a new world for Java development in general (Java 11 becomes stable, anything prior to that is now not publicly supported anymore so I don't want to run an Oracle JVM -> what are my options -> AdoptOpenJDK).
This issue is surprisingly blocking to a macos user :-)
@rubin55 A volunteer will have to pick this up - the core team is still working on some cross platform infra and build issues.
What is needed? As I’ve shown above, it is trivial to create an unsigned installer pkg. I have zero knowledge of how the build infrastructure is set up, so I do not know what is missing there. You would need an active Apple Developer account to sign the package, but apart from that, I guess it would only require an additional one-liner statement in a build script.
For those who want to run the currently provided AdoptOpenJDK as downloadable at https://adoptopenjdk.net/ , Here are some pointers. The below is tested with the current latest OpenJDK with HotSpot, version 1.8.0 r172 for MacOS:
Make sure you have root privileges:
/Library/Java/JavaVirtualMachines/1.8.0.jdk
mkdir -p /Library/Java/JavaVirtualMachines/1.8.0.jdk/Contents/MacOS
cd /Library/Java/JavaVirtualMachines/1.8.0.jdk/Contents
tar xzf /full/path/to/downloaded/OpenJDK8_x64_Mac_jdk8u172-b11.tar.gz
mv jdk8u172-b11 Home
unzip /full/path/to/downloaded/Info.plist Info.plist
cd MacOS
ln -s ../Home/jre/lib/jli/libjli.dylib
A. Check if AdoptOpenJDK shows up: /usr/libexec/java_home -V
B. Start another (non-root) terminal, run: export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
C. After that, verify the running Java version: java -version
The above was tested with various Java command line tools, like maven, javac. Additionally, I've tested various Java graphical applications, like Eclipse and MuleSoft Anypoint Studio.
@lenborje We have an Apple developer account and we do sign the existing Mac binaries. Are you a member on our #build channel in slack?
No, I’m not. What’s the URL?
@lenborje https://www.adoptopenjdk.net/slack.html
Thanks @rubin55 !
Today I decided to migrate to AdoptOpenJDK on my mac from OracleJDK because of recent news. I installed it with homebrew but everything went broken since /usr/libexec doesnt recognize it.
So I wrote a small script to install latest AdoptOpenJDK 10 on macos following @rubin55 's instructions. Now everything works as before. Hope that helps others as well.
I'm the maintainer of the OpenJDK ports in MacPorts. I'm currently using Oracle's OpenJDK builds, but I'm considering AdoptOpenJDK's builds.
I think it would be great if the AdoptOpenJDK releases for macOS would be ready to go when unpacked under /Library/Java/JavaVirtualMachines
, just like the Oracle OpenJDK builds, because otherwise MacPorts would have to duplicate the stuff the installer does in order to construct the directory structure expected by these macOS tools.
Hi all I am currently working on getting these brew recipes to install to /Library/Java/JavaVirtualMachines
. The main issue right now is that brew doesn't seem to be able to run with sudo which is needed to create folders in that directory. It appears that brew casks
might be able to do this but I'm still against using casks as that's designed for installing applications into /Applications
I think we might have to bite the bullet and go with cask... We can follow the similar recipe other OpenJDK and Oracle JDK casks
Ah, I see that the AdoptOpenJDK binaries for macOS now use the directory layout expected by macOS tools: https://blog.adoptopenjdk.net/2018/10/macos-binary-changes
Yes, we're pushing out one last release and then we'll update the homebrew tap's here and the casks at homebrew-core (and deprecate our tap versions in due course).
closing as the installers now work with this
See https://github.com/AdoptOpenJDK/openjdk-build/issues/321 for the history