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 6695769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:15:42+00:00 2026-05-26T06:15:42+00:00

For our SWT application I want to provide a generic Linux download bundle which

  • 0

For our SWT application I want to provide a generic Linux download bundle which can start on 32-bit- as well as 64-bit-VMs. Currently, we define the classpath using the manifest and start the application using java -jar main.jar. The manifest classpath contains multiple swt*.jars and the first matching one is picked (no problem, because currently only one is distributed for each platform).

Simply delivering both SWT libraries, swt-linux-32.jar and swt-linux-64.jar, looks not very promising, because then either the user would have to remove the wrong one manually or a script would have to set up the whole application classpath dynamically (scary!).

I’ve thought about providing two launcher scripts, one for 32-bit-VMs and the other for 64-bit-VMs, removing the swt.jars from the manifest classpath and adding the right one explicitly to the classpath, e.g. java -cp swt-linux-64.jar -jar main.jar. Unfortunately, it looks like one can’t mix explicit classpath definition (-cp) with implicit one (-jar).

One other solution could be explicitly set the classpathes in the launcher scripts, but this would make maintaining the scripts more complicated.

Of course, I would have the alternative to load the right swt.jar file dynamically in the application, but I’d prefer to keep the different file names out of the Java code.

Does anybody has some further better suggestion how we can manage it?

  • 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-26T06:15:43+00:00Added an answer on May 26, 2026 at 6:15 am

    Easy: do dynamic classloader manipulation. Have a loader JAR that sets up a new URLClassLoader depending on the 32/64-bit type of the runtime, and then load your main class from there – then call the main method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our application has a lot of .NET assemblies, which up until now, has not
Our application (Eclipse RCP-based, using a JFace/SWT-based interface) needs to support editing of mathematical
I am writing an application in Java using SWT. On our Solaris machines, we
We have a monitoring application built on swt and running on linux. we have
Our application uses libcurl for HTTP, and we want to get access to Internet
Our RCP application logs a fair bit, but only INFO and above are output
our delphi application can have multiple DirectX windows, often on multiple screens. up to
Our application is interfacing with a lot of web services these days. We have
Our security manager dynamically inserts a bit of javascript at the top of every
Our current web application url reveals the class package structure to the end user.

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.