Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

wrong ELF class: ELFCLASS64

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to run a Java program consisting of Berkeley XML librarys on a Linux system. After building the library, and running the program, I encounter this error:



This is the system that I am working on:



Any idea how do I resolve this?

Appreciate any help!

THanks!
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

You say you are trying to run a program on a Linux system, but the output of uname -a says that it's SunOS, which is not Linux.

Your Java program is trying to load a native library /home/ukhew1/dbxml-2.4.16/install/lib/libdb_java-4.6.so, but it looks like that native library is not suitable for the operating system you're trying to run it on. It's probably a 64-bit library (guessing from the ELFCLASS64), and your operating system is most likely not 64-bit.

Make sure that you get a native library that's appropriate for the operating system you're using.

It also looks like your system has a Sun SPARC processor. You'll need a native library for that processor, and not one for Intel x86 processors, for example.
 
U-Wei Khew
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jesper,

Thanks!

Apologize for the miscommunication. I build the buildall.sh file on another Linux machine and this was the error:



Do you have any idea on how to build this properly?

THanks!
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

warning: sparc:v8plus architecture of input file `.libs/xa_map.o' is incompatible with i386:x86-64 output


This means you have an object file xa_map.o that was compiled for the SPARC processor, and gcc on Linux, running on an Intel x86 processor, can't use that file.

Delete all *.o files before you build it on Linux. Maybe you need to do make clean before you build it on Linux.
 
U-Wei Khew
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jesper,

Thanks for the help.

Totally forgot that I change from a Solaris to a Linux.. thus the error.

Back to the error of wrong ELF class. I am trying to build the library for DBXML and that was the error. I understand that my OS is a 32 bit which I am unable to do anything about (because its a server Im running on). However I cant find the method to build this native library on 32 bits.
I tried using ./buildall.sh -b 32 as the argument ( as stated in the buildall.sh file) but the build is still in 64 bits:


From the Oracle forum, I gathered that we have to set the CFLAGS/CXXFLAGS/LDFLAGS in order to build a 32bit version by gcc...a method which he doesnt know too... Any idea how do we do that?

Thanks for your time!

 
U-Wei Khew
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jesper!

I got my problem sorted out!
Apparently, my JVM was a 32 bit JVM.. which was unable to run with a 64bit native lib...

Downloaded a 64 bit JVM from java and eveything settled!
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good to hear that you solved it.

By the way, if you can run a 64-bit JVM on your system, then your OS must also be 64-bit and not 32-bit as you said - you can't run 64-bit software on a 32-bit OS (the other way around does work, however, on Intel x86 systems).
 
U-Wei Khew
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, it is a 64 bit OS... being a newbie, had quite a hard time finding out the environment properties...

Thanks once again!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic