Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packaging app on Apple Silicon won't run without Rosetta #389

Open
2 of 5 tasks
wheelerlaw opened this issue Jan 19, 2024 · 4 comments
Open
2 of 5 tasks

Packaging app on Apple Silicon won't run without Rosetta #389

wheelerlaw opened this issue Jan 19, 2024 · 4 comments
Labels
question Further information is requested

Comments

@wheelerlaw
Copy link

I'm submitting a…

  • bug report
  • feature request
  • other

Short description of the issue/suggestion:

When I try to run an app that I packaged on a Mac with Apple silicon, the app will not run unless Rosetta is installed.

Steps to reproduce the issue/enhancement:

  1. Make sure Rosetta is not installed on your system
  2. Clone this repo: https://github.com/SteelecoSystems/sample-native-app
  3. Run mvn package
  4. Go into Finder, and try to run the app, and it should show the popup asking to install Rosetta.

What is the expected behavior?

It should not ask to install Rosetta, as I have a JDK installed that is universal. If I manually
run the jar using the JDK that gets bundled with the Mac app, it runs fine:

./target/sample-native-app/sample-native-app.app/Contents/PlugIns/jre.jre/Contents/Home/bin/java -jar ./target/sample-native-app/sample-native-app.app/Contents/Resources/Java/sample-native-app-1.0-SNAPSHOT-runnable.jar

What is the current behavior?

A popup appears asking for Rosetta to be installed.

Do you have outputs, screenshots, demos or samples which demonstrate the problem or enhancement?

I can produce one if you are unable to reproduce the issue.

What is the motivation / use case for changing the behavior?

If the Java Runtime running the Jar directly doesn't need Rosetta, then what else is happening with the App that requires it to be installed?

Please tell us about your environment:

  • JavaPackager version: 1.7.5
  • OS version: macOS Sonoma 14.2.1
  • JDK version: 21.0.1 (installed through Homebrew)
  • Build tool:
    • Maven
    • Gradle

Other information (e.g. related issues, suggestions how to fix, links for us to have context)

@fvarrui
Copy link
Owner

fvarrui commented Feb 23, 2024

Hi @wheelerlaw!
Sorry for my late reply.
How are you setting macConfig.macStartup property?

@fvarrui fvarrui added the question Further information is requested label Feb 23, 2024
@fvarrui
Copy link
Owner

fvarrui commented Feb 25, 2024

Ok, I've just seen ... sorry, missed the link to your demo app:

https://github.com/SteelecoSystems/sample-native-app/blob/fd9cd385c83edb622f6f19226ef8315613b1a97b/pom.xml#L1-L52

Please, try setting macConfig.macStartup=SCRIPT (so, it will use the non-compiled version of universalJavaApplicationStub, which is just a BASH script) ... If this way works fine, maybe could be a problem with the UNIVERSAL version of universalJavaApplicationStub

@fvarrui
Copy link
Owner

fvarrui commented Feb 25, 2024

I'm not sure if using a compiled version of the startup script (universalJavaApplicationStub) is worth ... in theory the app should start faster with a compiled version, but I haven't test this.

@fvarrui
Copy link
Owner

fvarrui commented Jun 30, 2024

Any news?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants