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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:31:10+00:00 2026-05-29T20:31:10+00:00

I am using JWebBrowser in a swing application. This class belongs to The DJ

  • 0

I am using JWebBrowser in a swing application. This class belongs to The DJ Project. It needs swt jar to execute. Now I have included swt jar for windows to my jar packaging of the application. I want to know how can I include swt jars for linux/mac in the same packaging? I am using ant to build the application jar. Should I build the jar putting different swt jar for different platform?

  • 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-29T20:31:12+00:00Added an answer on May 29, 2026 at 8:31 pm

    if you want to have a single build that runs on different platforms (Win/Mac/Linux/*nix) or architectures (32/64 bit) then you can bundle the SWT jar for each target platform with your installer and then load the correct one dynamically at runtime (or have your installer copy the correct SWT jar at installation time).

    E.g. say you want to support 32 and 64 bit Windows and Linux you would have SWT jars:

    lib/swt_win_32.jar
    lib/swt_win_64.jar
    lib/swt_linux_32.jar
    lib/swt_linux_32.jar
    

    Make your ant script / installer include all of these (they are about 1.6MB each) and then at runtime in your code you can detect the OS and architecture using the Java system properties

    System.getProperty("os.name");
    System.getProperty("os.arch");
    

    to build the name of the correct jar file.

    Loading the jar at runtime can be performed by a custom classloader or by calling the protected method URLClassloader.addURL(URL url) using reflection.

    I’ve put working code to perform this exact task on my website: http://www.chrisnewland.com/select-correct-swt-jar-for-your-os-and-jvm-at-runtime-191

    If you can stand the code-smell then it’s a quick solution to a very common SWT problem.

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

Sidebar

Related Questions

I'm using a WebBrowser control in my Visual C# (.net 2.0) application. Now I'd
I have opened a website using WebBrowser. Now I would like to programmatically click
I'm using webBrowser.Navigate(url) control to display page. I noticed this action steals focus from
Without using a WebBrowser control, how could I execute a JavaScript function, that is
I am using the webbrowser control in winforms and discovered now that background images
I am using WebBrowser control in the WinForms application. I want to write program
I have desktop application with WebBrowser control and try to inject JavaScript into loaded
Using a WebBrowser control in my Windows Forms application, I want to retrieve the
i m using webbrowser control in my c# application but the document_completed fun is
I'm using WebBrowser Control for my chat application. Every time it adds user's message

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.