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

How to build using a non-headless JDK? #114

Open
ships opened this issue Mar 7, 2024 · 2 comments
Open

How to build using a non-headless JDK? #114

ships opened this issue Mar 7, 2024 · 2 comments

Comments

@ships
Copy link

ships commented Mar 7, 2024

Hi friend, thanks so much for this package which promises to seriously solve some problems I am facing with making reproducible clojure environment! I really agree with much of the design sensibility.

I am encountering a problem that may be a bug but since I'm newish to this ecosystem there is also a chance I have simply misconfigured.

The issue is that I try to compile with openjdk17, not headless, because my application requires non-headless capabilities:

        cljNixApp = clj-nix.lib.mkCljApp {
          inherit pkgs;
          modules = [
            # Option list:
            # https://jlesquembre.github.io/clj-nix/options/
            {
              projectSrc = ./.;
              name = "inferenceql.query";
              main-ns = "inferenceql.query.main";

              # the important directive
              jdk = pkgs.openjdk17;
            }
          ];
        };

However, i still get an error in the clojure compile log like this: "Execution error (HeadlessException) at sun.awt.HeadlessToolkit/getMenuShortcutKeyMask (HeadlessToolkit.java:135).\n\nThe applicati on is not running in a desktop session,\nbut this program performed an operation which requires it.\n"

and so on. I don't expect headlessness at any point here, so I'm curious if i'm failing to specify it correctly. I notice that in various places in test and documentation i see the word jdkRunner rather than jdk = , but when I try that, clj-nix complains there is no such option.

Thanks again for your project & your guidance! Happy to contribute as I am able.

@ships
Copy link
Author

ships commented Mar 7, 2024

Ah, I found a Slack thread where you provided related thoughts to this very project that I will explore and report back here what i find:
https://clojurians.slack.com/archives/C02S1GEKU4C/p1701988611734399

@ships
Copy link
Author

ships commented Mar 15, 2024

Okay, having circled back, I wasn't able to solve this issue directly but my workaround is definitely workable for me: we use mk-deps-cache to generate a deps cache from the deps-lock.json and then pass that as an input to the uberjar build step, which uses native clojure instead of mkCljBin.

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

No branches or pull requests

1 participant