LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 09-24-2009, 03:13 PM   #1
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 13.37
Posts: 535

Rep: Reputation: 36
Is It Possible to "Spoof" the Java Version


I've just upgraded my system, to Slack64 13.0. One of the applications I'm trying to migrate, from my old set-up, is pure Java. It came packed with it's own copy of Java, which was a 32-bit version, which doesn't run on my system, as it's a pure 64-bit. I don't really want to go multi-lib just for this one program.

As the application is Java, I was hoping I could, at least, try it with the Java shipped with Slack64. However, I get the following error:
Code:
Arkeia Smart Backup GUI (5.4.3)
Java Virtual Machine vendor:    Sun Microsystems Inc.
Java Version:   1.6.0_16

Java 2 Runtime Environment version not supported: 1.6

This Java Virtual Machine is incompatible.
A Sun Java 2 Runtime Environment 1.4 or 1.5 is required.
Is there any way I can "fool" the application to run with this version of Java. I understand that even if I can "fool" it, it still may not work, because of the difference in the Java versions, but I'd at least like to give it a shot.

Cheers.
 
Old 09-24-2009, 04:21 PM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,950
Blog Entries: 5

Rep: Reputation: 755Reputation: 755Reputation: 755Reputation: 755Reputation: 755Reputation: 755Reputation: 755
You might be able to run the 32 bit Java that came with the application using the setarch command with i386 or i686 option (or the i386 command). These exist on RHEL4 and RHEL5 - not sure about other distros.

Basically it tells it to run as if it is in a 32 bit environment.

Alternatively I'm not sure that 1.5 is only 32 bit - you might be able to run a 64 bit version of that with your apps. You should be able to get 1.5 from java.sun.com.

Last edited by MensaWater; 09-24-2009 at 04:34 PM.
 
Old 09-24-2009, 05:25 PM   #3
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 13.37
Posts: 535

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by jlightner View Post
You might be able to run the 32 bit Java that came with the application using the setarch command with i386 or i686 option (or the i386 command). These exist on RHEL4 and RHEL5 - not sure about other distros.

Basically it tells it to run as if it is in a 32 bit environment.
From the man page:
Code:
       setarch This utility currently only affects the output of uname -m. For
       example,  on an AMD64 system, running 'setarch i386 program' will cause
       'program' to see i686 (or other relevant arch)  instead  of  x86_64  as
       machine  type.  It  also allows to set various personality options. The
       default program is /bin/sh.
But even if that command did anything useful, I still can't run a 32-bit, dynamically linked application, which Java is, without loading all the 32-bit libraries and going full multi-lib.

Cheers.
 
Old 09-25-2009, 01:02 AM   #4
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 666

Rep: Reputation: 132Reputation: 132
Quote:
Originally Posted by MQMan View Post
From the man page:
Code:
       setarch This utility currently only affects the output of uname -m. For
       example,  on an AMD64 system, running 'setarch i386 program' will cause
       'program' to see i686 (or other relevant arch)  instead  of  x86_64  as
       machine  type.  It  also allows to set various personality options. The
       default program is /bin/sh.
But even if that command did anything useful, I still can't run a 32-bit, dynamically linked application, which Java is, without loading all the 32-bit libraries and going full multi-lib.

Cheers.
You can try on the x86 box pack your 32 bit Java into self-contained executable use statifier (http://statifier.sf.net) or Ermine (http://magicErmine.com) and then copy only one file to your x86_64 box
 
Old 10-22-2009, 01:55 PM   #5
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 13.37
Posts: 535

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by Valery Reznic View Post
You can try on the x86 box pack your 32 bit Java into self-contained executable use statifier (http://statifier.sf.net) or Ermine (http://magicErmine.com) and then copy only one file to your x86_64 box
Finally got to try this. But it failed miserably:

With statifier
Code:
arkeiasb
Segmentation fault (core dumped)
And Ermine
Code:
arkeiasb
java: was packed with Ermine Trial and should be used for evaluation only.
java: license will expire in 31 day(s)
dl failure on line 732Error: failed /opt/arkeia/jre/lib/i386/client/libjvm.so, because libnsl.so.1: cannot open shared object file: No such file or directory
I guess Java is a little more complex, than a single executable, when it comes to this.

So, any other ideas floating around out there.

Cheers.
 
Old 10-22-2009, 04:05 PM   #6
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 666

Rep: Reputation: 132Reputation: 132
Quote:
Originally Posted by MQMan View Post
Finally got to try this. But it failed miserably:

With statifier
Code:
arkeiasb
Segmentation fault (core dumped)
And Ermine
Code:
arkeiasb
java: was packed with Ermine Trial and should be used for evaluation only.
java: license will expire in 31 day(s)
dl failure on line 732Error: failed /opt/arkeia/jre/lib/i386/client/libjvm.so, because libnsl.so.1: cannot open shared object file: No such file or directory
I guess Java is a little more complex, than a single executable, when it comes to this.

So, any other ideas floating around out there.

Cheers.
When invoked in the simplest form both statifier and Ermine pack only
executable itself and shared libraries shown by ldd.
Neither of them able on its own guess what libraries dlopen'ed.

But you can specify them yourself - either using --ld_preload option if you need pack some more shared libraries or if you need whole directory --config your config_file and in the your_config_file put
Code:
/path/to/dir internal
 
Old 10-22-2009, 04:25 PM   #7
jefro
Guru
 
Registered: Mar 2008
Posts: 11,105

Rep: Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362
Is there no way to install a 64 bit version of java 1.5?
 
Old 10-22-2009, 05:00 PM   #8
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 13.37
Posts: 535

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by jefro View Post
Is there no way to install a 64 bit version of java 1.5?
To be honest, I didn't think that there was a 64-bit version, prior to 1.6. It seems I'm lucky, in that you can only download the 1.5 version until October 30th. I'll give that a try first.

If not, then, I guess I should try:
Quote:
Originally Posted by Valery Reznic View Post
But you can specify them yourself - either using --ld_preload option if you need pack some more shared libraries or if you need whole directory --config your config_file and in the your_config_file put
Code:
/path/to/dir internal
Next.

Cheers.
 
Old 10-22-2009, 07:03 PM   #9
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 13.37
Posts: 535

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by jefro View Post
Is there no way to install a 64 bit version of java 1.5?
Yes, and that appears to have done the trick.

I get a couple of warnings, but they seem to be harmless.
Code:
arkeiasb                                            
Arkeia Smart Backup GUI (5.4.3)                                         
Java Virtual Machine vendor:    Sun Microsystems Inc.                   
Java Version:   1.5.0_21                                                
Xlib:  extension "Generic Event Extension" missing on display ":1012.0".
Xlib:  extension "Generic Event Extension" missing on display ":1012.0".
Cheers, and Thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Exception in thread "ConfigurableThreadImpl::" java.lang.OutOfMemoryError: unable to chidambaram Linux - Newbie 2 10-27-2006 10:06 PM
"java -version" hangs on RHEL3 nuzzy Red Hat 7 02-03-2006 11:29 AM
Java error "Exception in thread "main" java.lang.StackOverflowError" nro Programming 1 09-04-2004 03:47 AM
I cannot use "java chat". Browser says plugin required "x-java-vm". jdruin Linux - Software 4 04-18-2004 05:44 PM


All times are GMT -5. The time now is 09:33 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration