Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3751894
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:08:20+00:00 2026-05-19T09:08:20+00:00

In order to do some multi-platform GUI development, I have just switched from GTK

  • 0

In order to do some multi-platform GUI development, I have just switched from GTK + Clojure (because it looks like the Java bindings for GTK never got ported to Windows) to SWT + Clojure. So far, so good in that I have gotten an uberjar built for Linux.

The catch, though, is that I want to build an uberjar for Windows and I am trying to figure out a clean way to manage the project.clj file.

At first, I thought I would set the classpath to point to the SWT libraries and then build the uberjar. This would require that I set a classpath to the SWT libraries before running the jar, but I would likely need a launcher script, anyway. However, leiningen seems to ignore the classpath in this instance because it always reports that

Currently, project.clj looks like this for me:

(defproject alyra.mana-punk/character "1.0.0-SNAPSHOT"
  :description "FIXME: write"
  :dependencies [[org.clojure/clojure "1.2.0"]
                 [org.clojure/clojure-contrib "1.2.0"]
                 [org.eclipse/swt-gtk-linux-x86 "3.5.2"]]
  :main alyra.mana-punk.character.core)

The relevant line is the org.eclipse/swt-gtk-linux-x86 line. If I want to make an uberjar for Windows, I have to depend on org.eclipse/swt-win32-win32-x86, and another one for x86-64, and so on and so forth.

My current solution is to simply create a separate branch for each build environment with a different project.clj. This seems kinda like using a semi to deliver a single gallon of milk, but I am using bazaar for version control, so branching and repeated integrations are easy. Maybe the better way is to have a project.linux.clj, project.win32.clj, etc, but I do not see any way to tell leiningen which project descriptor to use.

What are other (preferably more elegant) ways to set up such an environment?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T09:08:20+00:00Added an answer on May 19, 2026 at 9:08 am

    Here’s a quite elegant solution using Java system properties:

    (let [properties (select-keys (into {} (System/getProperties))
                                  ["os.arch" "os.name"])
          platform (apply format "%s (%s)" (vals properties))
          swt (case platform
                "Windows XP (x86)" '[org.eclipse/swt-win32-win32-x86 "3.5.2"]
                "Linux (x86)"      '[org.eclipse/swt-gtk-linux-x86 "3.5.2"])]
      (defproject alyra.mana-punk/character "1.0.0-SNAPSHOT"
        :description "FIXME: write"
        :dependencies [[org.clojure/clojure "1.2.0"]
                       [org.clojure/clojure-contrib "1.2.0"]
                       ~swt]
        :main alyra.mana-punk.character.core))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a class is something like this public class Order { //some
I have a hashtable . values() method returns values in some order different from
I have some models and I want to generate a multi-selection form from this
I have a multi-select Box and I'm doing some javascript to sort the order
I would like to capture some sound from the microphone in cpp, in order
I have next tables Order , Transaction , Payment . Class Order has some
I have installed Sphinx in order to document some Python modules and class I'm
I am trying to use SDO2SHP.exe in order to export some spatial data from
For some unfortunate reasons, I have to convert a proprietary and binary library from
I have a multi-million row table with a varchar field. Some of the rows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.