LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 07-21-2014, 11:14 AM   #1
DBabo
Member
 
Registered: Feb 2003
Distribution: Fedora {latest}
Posts: 568

Rep: Reputation: 40
Question alternatives - how to use specific group | How to make thinkrswim work with Oracle/Sun and OpenJDK


"alternatives" - is there a way to specify a specific editor to use ?
for example:
i have 2 version of JAVA installed
i want JAVA version 1 be used by program ABC and JAVA version 2 used by all other programs on a machine ...


Update:
I was trying to see how to get thinkorswim to use specific version of java ( SUN/Oracle) using /etc/alternatives. It appears that it's not the right task for /etc/alternatives. For solution to thinkorswim problem see last post in the thread.

Last edited by DBabo; 07-21-2014 at 06:56 PM. Reason: changed title
 
Old 07-21-2014, 11:26 AM   #2
coralfang
Member
 
Registered: Nov 2010
Location: Bristol, UK
Distribution: Slackware, FreeBSD
Posts: 836
Blog Entries: 3

Rep: Reputation: 297Reputation: 297Reputation: 297
You can pass $JAVA_HOME to the script/program.

eg:
Code:
JAVA_HOME=/opt/java/jre1.6/ ./my_program
 
Old 07-21-2014, 01:08 PM   #3
DBabo
Member
 
Registered: Feb 2003
Distribution: Fedora {latest}
Posts: 568

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by coralfang View Post
You can pass $JAVA_HOME to the script/program.

eg:
Code:
JAVA_HOME=/opt/java/jre1.6/ ./my_program
Did that. Apparently, application requires something else (classes or some other execs ) particular to the java version.
 
Old 07-21-2014, 02:55 PM   #4
YankeePride13
Member
 
Registered: Aug 2012
Distribution: Ubuntu 10.04, CentOS 6.3, Windows 7
Posts: 262

Rep: Reputation: 55
You need to add the path to the classes to your CLASSPATH variable.
 
Old 07-21-2014, 02:58 PM   #5
DBabo
Member
 
Registered: Feb 2003
Distribution: Fedora {latest}
Posts: 568

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by YankeePride13 View Post
You need to add the path to the classes to your CLASSPATH variable.
right, so should this be handled by alternatives?
 
Old 07-21-2014, 03:01 PM   #6
YankeePride13
Member
 
Registered: Aug 2012
Distribution: Ubuntu 10.04, CentOS 6.3, Windows 7
Posts: 262

Rep: Reputation: 55
You can set it up the same way you did JAVA_HOME in DBabo's comment. I am not sure if that answers your question.
 
Old 07-21-2014, 06:35 PM   #7
DBabo
Member
 
Registered: Feb 2003
Distribution: Fedora {latest}
Posts: 568

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by YankeePride13 View Post
You can set it up the same way you did JAVA_HOME in DBabo's comment. I am not sure if that answers your question.
weeelll. here is some internal info.
so i have thinkorswim which requires Oracle Java. on OpenJDK it won't run - that is the fact. I removed all java, installed openjdk - no go. Replaced it with Oracle - works fine.

Next step is i'm trying to "marry" Oracle and OpenJDK in such a way that thinkorswim works and all other apps that require Open ( libreOffice for example) work too.
So i had Oracle 1.7 installed on an empty ( no openjdk) machine and confirmed that thnkorswim work.
Next i installed openJDK 1.7 and confirmed that everything else works but thinkorswim.
Next i set Java_HOME=/usr/bin/java/default:

Code:
echo $JAVA_HOME
/usr/java/default
[xxxx@localhost thinkorswim]$ ls -l /usr/java/default
lrwxrwxrwx 1 root root 16 Jul 15 11:25 /usr/java/default -> /usr/java/latest

which java
/usr/bin/java

[xxxx@localhost thinkorswim]$ java -version
java version "1.7.0_60"
OpenJDK Runtime Environment (fedora-2.5.0.1.fc20-x86_64 u60-b30)
OpenJDK 64-Bit Server VM (build 24.60-b09, mixed mode)
when i run thinkorswim it just sits and "applying updates".

here is the strace on the java call. I removed all non relevent info. As you can see it somehow picks up openjdk which is the problem.

Code:
6609  open("/usr/bin/java", O_RDONLY)   = 3
6609  open("/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.5.0.1.fc20.x86_64/jre/lib/amd64/jli/tls/x86_64/libpthread.so.0", O_RDONLY|O_
CLOEXEC) = -1 ENOENT (No such file or directory)
6609  open("/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.5.0.1.fc20.x86_64/jre/lib/amd64/jli/tls/libpthread.so.0", O_RDONLY|O_CLOEXEC
) = -1 ENOENT (No such file or directory)
6609  open("/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.5.0.1.fc20.x86_64/jre/lib/amd64/jli/x86_64/libpthread.so.0", O_RDONLY|O_CLOE
XEC) = -1 ENOENT (No such file or directory)
6609  open("/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.5.0.1.fc20.x86_64/jre/lib/amd64/jli/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 
-1 ENOENT (No such file or directory)
6609  open("/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.5.0.1.fc20.x86_64/lib/amd64/tls/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC)
 = -1 ENOENT (No such file or directory)
6609  open("/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.5.0.1.fc20.x86_64/lib/amd64/tls/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 E
NOENT (No such file or directory)
6609  open("/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.5.0.1.fc20.x86_64/lib/amd64/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -
1 ENOENT (No such file or directory)
6609  open("/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.5.0.1.fc20.x86_64/lib/amd64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOEN
T (No such file or directory)
6609  open("/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.5.0.1.fc20.x86_64/jre/lib/amd64/tls/x86_64/libpthread.so.0", O_RDONLY|O_CLOE
XEC) = -1 ENOENT (No such file or directory)
6609  open("/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.5.0.1.fc20.x86_64/jre/lib/amd64/tls/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 
-1 ENOENT (No such file or directory)
6609  open("/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.5.0.1.fc20.x86_64/jre/lib/amd64/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC)
 = -1 ENOENT (No such file or directory)
6609  open("/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.5.0.1.fc20.x86_64/jre/lib/amd64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 E
NOENT (No such file or directory)
6609  open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
6609  open("/lib64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
6609  open("/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.5.0.1.fc20.x86_64/jre/lib/amd64/jli/libjli.so", O_RDONLY|O_CLOEXEC) = 3
6609  open("/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.5.0.1.fc20.x86_64/jre/lib/amd64/jli/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 EN
OENT (No such file or directory)
6609  open("/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.5.0.1.fc20.x86_64/jre/lib/amd64/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT
 (No such file or directory)
6609  open("/lib64/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3


[xxxx@localhost thinkorswim]$ locate libpthread
/usr/lib64/libpthread-2.18.so
/usr/lib64/libpthread.so
/usr/lib64/libpthread.so.0
/usr/lib64/libpthread_nonshared.a
/var/oracle/product/11.2.0/client_1/lib/stubs/libpthread-2.3.4-stub.so
/var/oracle/product/11.2.0/client_1/lib/stubs/libpthread.so
/var/oracle/product/11.2.0/client_1/lib/stubs/libpthread.so.0
/var/oracle/product/11.2.0/client_1/lib/stubs/libpthread.tmp

[xxxx@localhost thinkorswim]$ ls -l /usr/lib64/libpthread.so
-rw-r--r--. 1 root root 222 Jan 23 05:38 /usr/lib64/libpthread.so
[azyman@localhost thinkorswim]$ ls -l /usr/lib64/libpthread.so
libpthread.so    libpthread.so.0  
[xxxx@localhost thinkorswim]$ ls -l /usr/lib64/libpthread.so.0 
lrwxrwxrwx. 1 root root 18 Jul 10 14:36 /usr/lib64/libpthread.so.0 -> libpthread-2.18.so
[xxxx@localhost thinkorswim]$ rpm -qf /usr/lib64/libpthread.so.0
glibc-2.18-12.fc20.x86_64
[xxxx@localhost thinkorswim]$ locate libjli
/usr/java/jre1.7.0_60/lib/amd64/jli/libjli.so
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.5.0.1.fc20.x86_64/jre/lib/amd64/jli/libjli.so
any ideas?
 
1 members found this post helpful.
Old 07-21-2014, 06:51 PM   #8
DBabo
Member
 
Registered: Feb 2003
Distribution: Fedora {latest}
Posts: 568

Original Poster
Rep: Reputation: 40
ohhhh. i'm a stupid monkey, i made a simple task more difficult when it should be :
in the thinkorswim shell launcher _they_ specify :
Code:
# Uncomment the following line to override the JVM search sequence
INSTALL4J_JAVA_HOME_OVERRIDE=/usr/java/default
# Uncomment the following line to add additional VM parameters
# INSTALL4J_ADD_VM_PARAMS=
which is what i did (bold) and now it works fine.
It interesting to note that if this variable is not set ( default) then the script goes over all over options. Such as checking variable passed and eventually arrives to env variable set for the session. YET, the only option that makes the app to wirk is to set OVERRIDE var on top of the script.
 
  


Reply

Tags
alternatives


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
Permission on specific Directory / File to specific group AbidDhanaiser Linux - Desktop 1 08-28-2013 03:38 AM
[SOLVED] bash looping through a group of files alternatives to ls? patolfo Linux - Software 4 03-10-2012 07:19 AM
Locate Users In A Specific Group carlosinfl Linux - General 3 12-20-2011 11:38 AM
How to make a specific command(s) work for specific users or group only naren_0101bits Linux - General 3 08-28-2005 05:22 PM
How to set permissions for a specific group? tigerhuang Linux - Security 1 12-10-2004 05:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:51 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration