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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:45:31+00:00 2026-06-12T14:45:31+00:00

I put rxtxcomm.jar into jre/lib/ext folder, but I still get NoClassDefFoundError Isn’t this folder

  • 0

I put rxtxcomm.jar into jre/lib/ext folder, but I still get NoClassDefFoundError Isn’t this folder automatically taken into the global classpath?

Thanks

  • 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-06-12T14:45:33+00:00Added an answer on June 12, 2026 at 2:45 pm

    yes it is taken automatically to classpath, but RXTXcomm uses JNI /native external libraries (.so and .dll files), you must provide the path to them when running your program in command line:

    java -jar yourprogram.jar -Djava.library.path="PATH_TO_EXTERNAL_LIBRARIES"
    

    for linux:

    suppose you unpacked the rxtx.zip to
    /home/user/

    if you have 32bit x86 platofrm:

    PATH_TO_EXTERNAL_LIBRARIES = /home/user/Linux/i686-unknown-linux-gnu/

    if you have 64bit x86 platform the it would be:

    PATH_TO_EXTERNAL_LIBRARIES = /home/user/Linux/x86_64-unknown-linux-gnu/

    for windows:

    suppose you downloaded and unpacked it to C:\rxtxt

    PATH_TO_EXTERNAL_LIBRARIES = C:\rxtxt\Windows\i368-mingw32\

    If you find it cumbersome to do it from command line you can do it from yout code (before opening port via RXTXcomm):

    System.setProperty("java.library.path","PATH_TO_EXTERNAL_LIBRARIES");
    

    EDIT:

    of course, you must put RXTXcomm.jar in your classpath in addition to all of the above. If running from command line as jar packaged program – yourprogram.jar – inside the jar you must have a META-INF folder that contains MANIFEST.MF with the following entries:

    Class-Path: lib/RXTXcomm.jar
    Main-Class: pkg.Main
    

    and yourprogram.jar must be in folder which has folder lib in which is RXTXcomm.jar, also
    the class with

    public static void main(String[] args)
    

    method must be called Main and reside in package named pkg (just replace pkg.Main with whatever you have).

    Then you can run your program succesfully and open a serial port if you have one. This approach also eliminates the need to copy anything in jre/lib/ext folder

    EDIT^2:

    or, if you don’t want to pack your program in jar, position yourself in folder which contains the folder pkg and write:

    java -cp PATH_TO_RXTX/RXTXcomm.jar -Djava.library.path="PATH_TO_EXTERNAL_LIBRARIES" pkg.Main
    

    (all paths can be relative or absolute)

    EDIT^3:

    but I would recommend Java Simple Serial Connector instead of RXTXcomm:

    • it handles heavy load from multiple threads as opposed to RXTXcomm (tested in production)
    • external libraries are packed in jar so there is no need for setting java.library.path
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Simply put, I had this working: java -cp .:bin:MyJar.jar path.to.My.Main but this threw an
i put this in Global.asax.cs routes.MapWebFormRoute(Page, Page/{*anything}, ~/Page.aspx, false); how i can get value
Put this code into MS Visual C++ 2010, compile (debug or release), and it
I put a favicon in my application root folder. But I can't display it.
I put this in my Rails controller send_file('/public/images/rails.png') but it gives error Cannot read
Put them all in one separate folder structure or along with classes which implements
Put value as a field makes sense only if this one represents some object's
I put a TileGroup in a BorderContainer and set the width to 100%, but
I put together this quick carousel that I'm using to cycle through different divs
I put my files in the directory assets. how do I get them? I

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.