GithubHelp home page GithubHelp logo

Comments (6)

crotwell avatar crotwell commented on August 24, 2024

Just tested here with bundleJRE=true and it worked, so not sure what to say. I assume you have java from installed?

What version of OSX? What version of Java?

What is the output of:
/usr/libexec/java_home

Did you set jreHome?

from gradle-macappbundle.

orsjb avatar orsjb commented on August 24, 2024

OSX 10.12.6
I have two versions of Java installed: jdk-9.jdk, jdk1.8.0_121.jdk
So java_home points to jdk-9 at the moment (I did try removing jdk-9, apparently Mac OS simply picks the most recent version, this didn't make any difference).
My gradle project has source compatibility set to 1.8. I'm quite new to gradle. I'm not 100% sure which java version I'm running when I run the project from gradle. I can check. Where can I see the bundled JRE?

I've also noticed a separate issue, which may not be an issue of your builder per se (so I won't log it unless you want me to). When I run my app (with bundleJRE = false) by double clicking on it, some part of the program is not running properly. However, if I run the app by calling MyApp.app/Contents/MacOS/JavaAppLauncher from the terminal it works as expected. I need to investigate more what is failing. My first thought was that certain resources are not loading, but they seem to be. So I wonder if something to do with JavaFX graphics rendering is not behaving in the same way. I realise this is incredibly vague - that's because I don't know how to see the standard out and error when running the app, so I can't tell what is failing. Is there a log file somewhere that will show me the Java stdout and stderr?

Anyway, thanks for making such an awesome plugin. This is surely the missing ingredient to make gradle the winner Java build tool.

from gradle-macappbundle.

orsjb avatar orsjb commented on August 24, 2024

PS those are both Oracle Java.

from gradle-macappbundle.

crotwell avatar crotwell commented on August 24, 2024

Java is copied into the Contents/PlugIns directory inside the app, so for example
TestApp.app/Contents/PlugIns/jdk1.8.0_51.jdk

You can try running your app from the command line with
open Test.app
which is closer to double clicking than directly running JavaAppLauncher

from gradle-macappbundle.

orsjb avatar orsjb commented on August 24, 2024

OK thanks. So the Java 9 JDK was being bundled. I assume this is done based on the system settings (use whichever JDK is most recent), as I don't see any setting saying to use JDK 9. When I removed JDK 9 from my /Libraries/Java/JavaVirtualMachines folder everything worked perfectly and the app had Java 8 bundled.

Thank you! Perhaps the world is just not ready for Java 9 ;-)

from gradle-macappbundle.

crotwell avatar crotwell commented on August 24, 2024

I'll check into the java9 issue.

You can also set jreHome within the macAppBundle section if you want to choose a particular jre. Otherwise it uses whatever the output of /usr/libexec/java_home is.

from gradle-macappbundle.

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.