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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:01:42+00:00 2026-05-11T22:01:42+00:00

I need to implemente a Java class which uses JNI to control a fiscal

  • 0

I need to implemente a Java class which uses JNI to control a fiscal printer in
XUbuntu 8.10 with sun-java6-jdk installed.

The structure is the following:

EpsonDriver.java loads libEpson.so

libEpson is linked dynamically with EpsonFiscalProtocol.so ( provided by Epson, no source available ) and pthread

I use javah to generate the header file, and the code compiles. Then I put the libEpson.so in $JAVA_HOME/jre/lib/i386, and EpsonDriver.java uses an static initializar

System.loadLibrary("libEpson")

That part works, however, when I try to use any of the methods I get an unsatisfiedLinkError exception.

Some time ago, a coworker did a version that works, and using objdump -Dslx I got the following:

Program Header:
    LOAD off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12
         filesz 0x0000ccc4 memsz 0x0000ccc4 flags r-x
    LOAD off    0x0000d000 vaddr 0x0000d000 paddr 0x0000d000 align 2**12
         filesz 0x00000250 memsz 0x00044a5c flags rw-
 DYNAMIC off    0x0000d014 vaddr 0x0000d014 paddr 0x0000d014 align 2**2
         filesz 0x000000f0 memsz 0x000000f0 flags rw-
    NOTE off    0x000000d4 vaddr 0x000000d4 paddr 0x000000d4 align 2**2
         filesz 0x00000024 memsz 0x00000024 flags r--
   STACK off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**2
         filesz 0x00000000 memsz 0x00000000 flags rw-

Dynamic Section:
  NEEDED               EpsonFiscalProtocol.so
  NEEDED               libpthread.so.0
  NEEDED               libstdc++.so.6
  NEEDED               libm.so.6
  NEEDED               libc.so.6
  SONAME               libcom_tichile_jpos_EpsonSerialDriver.so
  INIT                 0x00007254
  FINI                 0x0000ba08
  GNU_HASH             0x000000f8
  STRTAB               0x00001f50
  SYMTAB               0x00000ae0
  STRSZ                0x00002384
  SYMENT               0x00000010
  PLTGOT               0x0000d108
  PLTRELSZ             0x00000008
  PLTREL               0x00000011
  JMPREL               0x0000724c
  REL                  0x000045c4
  RELSZ                0x00002c88
  RELENT               0x00000008
  TEXTREL              0x00000000
  VERNEED              0x00004564
  VERNEEDNUM           0x00000002
  VERSYM               0x000042d4
  RELCOUNT             0x000000ac

Version References:
  required from libstdc++.so.6:
    0x056bafd3 0x00 05 CXXABI_1.3
    0x08922974 0x00 04 GLIBCXX_3.4
  required from libc.so.6:
    0x0b792650 0x00 03 GCC_3.0
    0x0d696910 0x00 02 GLIBC_2.0

In the recently compiled file I get:

Program Header:
    LOAD off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12
         filesz 0x00005300 memsz 0x00005300 flags r-x
    LOAD off    0x00005300 vaddr 0x00006300 paddr 0x00006300 align 2**12
         filesz 0x00000274 memsz 0x00010314 flags rw-
 DYNAMIC off    0x00005314 vaddr 0x00006314 paddr 0x00006314 align 2**2
         filesz 0x000000e0 memsz 0x000000e0 flags rw-
EH_FRAME off    0x00004a00 vaddr 0x00004a00 paddr 0x00004a00 align 2**2
         filesz 0x00000154 memsz 0x00000154 flags r--

Dynamic Section:
  NEEDED               libstdc++.so.5
  NEEDED               libm.so.6
  NEEDED               libgcc_s.so.1
  NEEDED               libc.so.6
  SONAME               EpsonFiscalProtocol.so
  INIT                 0x00001cb4
  FINI                 0x00004994
  HASH                 0x000000b4
  STRTAB               0x00000da4
  SYMTAB               0x000004f4
  STRSZ                0x00000acf
  SYMENT               0x00000010
  PLTGOT               0x0000640c
  PLTRELSZ             0x00000270
  PLTREL               0x00000011
  JMPREL               0x00001a44
  REL                  0x000019dc
  RELSZ                0x00000068
  RELENT               0x00000008
  VERNEED              0x0000198c
  VERNEEDNUM           0x00000002
  VERSYM               0x00001874
  RELCOUNT             0x00000004

Version References:
  required from libstdc++.so.5:
    0x056bafd2 0x00 04 CXXABI_1.2
  required from libc.so.6:
    0x09691f73 0x00 03 GLIBC_2.1.3
    0x0d696910 0x00 02 GLIBC_2.0

So I suspect the main diference is the GCC_3.0 symbol

I compile libcom_tichile_EpsonSerialDriver.so with the following command ( from memory as I not at work right now )

g++ -Wl,-soname=.... -shared -I/*jni libraries*/ -o libcom_tichile_jpos_EpsonSerialDriver -lEpsonFiscalProtocol -lpthread

Is there any way to tell g++ to use that symbol version? Or any idea in how to make it work?

EDIT: I have another non-working version with the followin dump:

Program Header:
    LOAD off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12
         filesz 0x0000bf68 memsz 0x0000bf68 flags r-x
    LOAD off    0x0000cc0c vaddr 0x0000cc0c paddr 0x0000cc0c align 2**12
         filesz 0x000005e8 memsz 0x00044df0 flags rw-
 DYNAMIC off    0x0000cc20 vaddr 0x0000cc20 paddr 0x0000cc20 align 2**2
         filesz 0x000000f8 memsz 0x000000f8 flags rw-
EH_FRAME off    0x0000b310 vaddr 0x0000b310 paddr 0x0000b310 align 2**2
         filesz 0x000002bc memsz 0x000002bc flags r--
   STACK off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**2
         filesz 0x00000000 memsz 0x00000000 flags rw-
   RELRO off    0x0000cc0c vaddr 0x0000cc0c paddr 0x0000cc0c align 2**0
         filesz 0x000003f4 memsz 0x000003f4 flags r--

Dynamic Section:
  NEEDED               EpsonFiscalProtocol.so
  NEEDED               libpthread.so.0
  NEEDED               libstdc++.so.6
  NEEDED               libm.so.6
  NEEDED               libgcc_s.so.1
  NEEDED               libc.so.6
  SONAME               libcom_tichile_jpos_EpsonSerialDriver.so
  INIT                 0x000055d8
  FINI                 0x0000a968
  HASH                 0x000000f4
  GNU_HASH             0x00000a30
  STRTAB               0x00002870
  SYMTAB               0x00001410
  STRSZ                0x00002339
  SYMENT               0x00000010
  PLTGOT               0x0000cff4
  PLTRELSZ             0x00000168
  PLTREL               0x00000011
  JMPREL               0x00005470
  REL                  0x00004ea8
  RELSZ                0x000005c8
  RELENT               0x00000008
  VERNEED              0x00004e38
  VERNEEDNUM           0x00000002
  VERSYM               0x00004baa
  RELCOUNT             0x00000001

Version References:
  required from libstdc++.so.6:
    0x056bafd3 0x00 05 CXXABI_1.3
    0x08922974 0x00 03 GLIBCXX_3.4
  required from libc.so.6:
    0x09691f73 0x00 06 GLIBC_2.1.3
    0x0d696914 0x00 04 GLIBC_2.4
    0x0d696910 0x00 02 GLIBC_2.0

Now I think the main difference is in the GCC_3.0 symbol/ABI

EDIT: Luckily, a coworker found a way to talk to the printer using Java

  • 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-11T22:01:43+00:00Added an answer on May 11, 2026 at 10:01 pm

    No. They are mean to be incompatible. You have to use a older version of g++.

    Also, the different is at libstdc++.so.5 and libstdc++.so.6.

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

Sidebar

Ask A Question

Stats

  • Questions 231k
  • Answers 231k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use the following function like this: Image('/path/to/original.image', '1/1', '150*', './thumb.jpg');… May 13, 2026 at 2:13 am
  • Editorial Team
    Editorial Team added an answer Check you database schema to see if the field (referenced… May 13, 2026 at 2:13 am
  • Editorial Team
    Editorial Team added an answer I figured out the problem - there was a session… May 13, 2026 at 2:13 am

Related Questions

I am developing a simple web application which contains these 3 components: client that
For my Swing project, I need to support both Java 5 and Java 6
Suppose I am defining a Haskell function f (either pure or an action) and
I have a Java class that looks like this: public class My_ABC { int

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.