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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:52:08+00:00 2026-05-21T03:52:08+00:00

Ultimately I would like to use a Java program to send and receive messages

  • 0

Ultimately I would like to use a Java program to send and receive messages from a phone that I have plugged in via USB. I can do this using a C# program, however the program I want to send and receive messages is written in Java. To do this I am using the Rxtx library (but using the Windows x64 compiled version from Cloudhopper). But whenever I try and send any commands to the phone via USB my computer completely locks up and I have to hard-restart it.

The code I am running is here: Two way communication with the serial port. I think that it successfully establishes a link since it gets to the stage where it accepts input from the console, though when I press enter, and the input is sent, the computer locks up.

I am running Windows 7 x64, using Eclipse. Thank you for any help.

  • 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-21T03:52:09+00:00Added an answer on May 21, 2026 at 3:52 am

    A little hard to tell from the code, but here are some debugging tips:

    • Try stepping through the code with the debugger line by line, and step in to the library itself to see if you can find the problem.
    • Instead of reading/writing from the console, try sending character codes programmatically. The console operates very differently from direct access. i.e. instead of System.in.read()) just try passing in a known good String.
    • Keep in mind that Java works with UCS-16 internally, but that consoles typically work with different character encodings (e.g. cp1252 for Windows). So, your “enter” may be a completely different character from what the system is expecting. If your device is expecting ASCII 13 and your keyboard is generating ASCII 12, that could be enough to confuse things.
    • The crash makes it seem very likely that there is something going on with the native library. If you find that the Java debugging keeps dropping you into the JNI boundary, you may need to debug with a C/C++ toolset.

    Good luck!

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

Sidebar

Related Questions

I have two arrays that I would like to compare and ultimately wind up
I have a controller that handles file uploads. Ultimately I would like to be
Ultimately, I would like to use Inflector.parameterize to create slugs for article heading that
I have a Java programming lab-exercise in a course with students that I'd like
I have a form where users can enter data that ultimately would be used
Currently I would simply like to find all files that have not been modified
Background Information: Ultimately, I would like to write an emulator of a real machine
I am working on a C++ library. Ultimately, I would like to make it
Problem I would like to trace the Uri that will be generated by a
I have a nested form in which I would like the form fields to

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.