Fedora Linux Support Community & Resources Center
  #1  
Old 14th June 2012, 12:28 PM
R0b0ty Offline
Registered User
 
Join Date: Jun 2011
Location: GA
Posts: 22
linuxchrome
Sun JDK Install Quesiton

Hi, all.

I have a program that requires Sun's Java (JDK) - it explicitly states that it's not fully compatible with OpenJDK. I found several posts on how to install Sun's JDK.

My question is this... do I need to uninstall the Fedora default OpenJDK? I'm currently running Fedora 17, 32-bit.

---------- Post added 14th June 2012 at 07:28 AM ---------- Previous post was 13th June 2012 at 11:34 PM ----------

Answer: Yes you can have multiple java versions installed.

Great guide here:

http://www.if-not-true-then-false.co...-red-hat-rhel/
Reply With Quote
  #2  
Old 28th January 2013, 05:33 PM
obsidiana Offline
Registered User
 
Join Date: May 2008
Location: Mexico City
Age: 49
Posts: 43
linuxfirefox
Re: Sun JDK Install Quesiton

Quote:
Originally Posted by R0b0ty View Post
Hi, all.

I have a program that requires Sun's Java (JDK) - it explicitly states that it's not fully compatible with OpenJDK. I found several posts on how to install Sun's JDK.

My question is this... do I need to uninstall the Fedora default OpenJDK? I'm currently running Fedora 17, 32-bit.

---------- Post added 14th June 2012 at 07:28 AM ---------- Previous post was 13th June 2012 at 11:34 PM ----------

Answer: Yes you can have multiple java versions installed.

Great guide here:

http://www.if-not-true-then-false.co...-red-hat-rhel/
I have tried to install with the command:
rpm -ivh jdk-7u11-linux-x64.rpm
Preparando... ################################# [100%]
Actualizando / instalando...
1:jdk-2000:1.7.0_11-fcs ################################# [100%]
Unpacking JAR files...
rt.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_11/jre/lib/rt.pack
jsse.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_11/jre/lib/jsse.pack
charsets.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_11/jre/lib/charsets.pack
tools.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_11/lib/tools.pack
localedata.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_11/jre/lib/ext/localedata.pack

What's next?
Reply With Quote
  #3  
Old 28th January 2013, 06:13 PM
PabloTwo's Avatar
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,126
linuxchrome
Re: Sun JDK Install Quesiton

Quote:
Unpacking JAR files...
rt.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_11/jre/lib/rt.pack
jsse.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_11/jre/lib/jsse.pack
charsets.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_11/jre/lib/charsets.pack
tools.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_11/lib/tools.pack
localedata.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_11/jre/lib/ext/localedata.pack
This is normal output from the Sun/Oracle JRE/JDK rpm install. You can safely ignore those "Error:" lines.
What does "java -version" report now?
If it's still reporting the openJDK java, you'll need to run the "alternatives --config java" command to make the Sun/Oracle java your default. You might want to run "alternatives --display java" first, to insure the Sun/Oracle java got installed into alternatives.

---------- Post added at 01:13 PM ---------- Previous post was at 01:01 PM ----------

This guide should work for the JDK package as well as the JRE package, just the rpm package names are different.
Reply With Quote
  #4  
Old 30th January 2013, 01:28 AM
obsidiana Offline
Registered User
 
Join Date: May 2008
Location: Mexico City
Age: 49
Posts: 43
linuxfirefox
Re: Sun JDK Install Quesiton

I have done all this, and still having a message indicating
"No existe una aplicación instalada para los archivos «ejecutable».
¿Quiere buscar una aplicación para abrir este archivo?"

"There is no apprilcation installed for the file..."
or something like that

I have included some outputs to make it more informative, sorry for the extension.

Code:
root@localhost Linux]# rpm -ivh jdk-7u11-linux-x64.rpm
Preparando...                         ################################# [100%]
Actualizando / instalando...
   1:jdk-2000:1.7.0_11-fcs            ################################# [100%]
Unpacking JAR files...

root@localhost Linux]# alternatives --display java
java - el estado es manual.
el enlace apunta actualmente a /usr/java/latest/jre/bin/java
/usr/java/latest/jre/bin/java - prioridad 20000
 esclavo keytool: (null)
 esclavo orbd: (null)
 esclavo pack200: (null)
...
La 'mejor' versión actual es /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java.

[root@localhost Linux]# alternatives --config java

Hay 3 programas que proporcionan 'java'.

  Selección    Comando
-----------------------------------------------
 + 1           /usr/java/latest/jre/bin/java
*  2           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
   3           /usr/lib/jvm/jre-1.5.0-gcj/bin/java

[root@localhost Linux]# alternatives --install /usr/bin/java java /usr/java/latest/jre/bin/java 20000
[root@localhost Linux]# alternatives --install /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws 20000
[root@localhost Linux]# alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /usr/java/latest/jre/lib/amd64/libnpjp2.so 20000

[root@localhost Linux]# alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 20000
[root@localhost Linux]# alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar 20000
[root@localhost Linux]# alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_11/jre/bin/java 20000
[root@localhost Linux]# alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.7.0_11/jre/bin/javaws 20000
[root@localhost Linux]# alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /usr/java/jdk1.7.0_11/jre/lib/amd64/libnpjp2.so 20000
[root@localhost Linux]# alternatives --install /usr/bin/javac javac /usr/java/jdk1.7.0_11/bin/javac 20000
[root@localhost Linux]# alternatives --install /usr/bin/jar jar /usr/java/jdk1.7.0_11/bin/jar 20000
[root@localhost Linux]# alternatives --config java

Hay 4 programas que proporcionan 'java'.

  Selección    Comando
-----------------------------------------------
 + 1           /usr/java/latest/jre/bin/java
*  2           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
   3           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
   4           /usr/java/jdk1.7.0_11/jre/bin/java

Presione Intro para mantener la selección actual[+], o escriba el número de la selección:  4
[root@localhost Linux]# java -version
java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
[root@localhost Linux]# javaws
Java(TM) Web Start 10.11.2.21-fcs 
...
[root@localhost Linux]# javac -version
javac 1.7.0_11
[root@localhost Linux]# alternatives --config javaws

Hay 2 programas que proporcionan 'javaws'.

  Selección    Comando
-----------------------------------------------
*+ 1           /usr/java/latest/jre/bin/javaws
   2           /usr/java/jdk1.7.0_11/jre/bin/javaws

Presione Intro para mantener la selección actual[+], o escriba el número de la selección:  
[root@localhost Linux]# alternatives --config javac

Hay 2 programas que proporcionan 'javac'.

  Selección    Comando
-----------------------------------------------
*+ 1           /usr/java/latest/bin/javac
   2           /usr/java/jdk1.7.0_11/bin/javac

[root@localhost Linux]# export JAVA_HOME="/usr/java/jdk1.7.0_11"
Is there something lacking?
Reply With Quote
  #5  
Old 30th January 2013, 04:04 AM
PabloTwo's Avatar
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,126
linuxchrome
Re: Sun JDK Install Quesiton

It appears you have everything setup OK. You would need to add the line export JAVA_HOME="/usr/java/jdk1.7.0_11" to your user ~/.bashrc and/or /root/.bashrc file to make it persistent.

You may need to disable the icedtea-web browser plugin in your browser so it doesn't conflict with the libnpjp2.so plugin. You could also just "yum erase icedtea-web" assuming you have it installed.
Reply With Quote
  #6  
Old 30th January 2013, 09:20 AM
obsidiana Offline
Registered User
 
Join Date: May 2008
Location: Mexico City
Age: 49
Posts: 43
linuxfirefox
Re: Sun JDK Install Quesiton

Quote:
Originally Posted by PabloTwo View Post
It appears you have everything setup OK. You would need to add the line export JAVA_HOME="/usr/java/jdk1.7.0_11" to your user ~/.bashrc and/or /root/.bashrc file to make it persistent.

You may need to disable the icedtea-web browser plugin in your browser so it doesn't conflict with the libnpjp2.so plugin. You could also just "yum erase icedtea-web" assuming you have it installed.
Thanks Pablo, how do I export this value to the mentioned files?
can I copy and paste into the files?
I which section?

I am trying to start XMind: a Java application based on Eclipse

Last edited by obsidiana; 30th January 2013 at 10:27 AM. Reason: adding information
Reply With Quote
  #7  
Old 14th February 2013, 08:03 PM
obsidiana Offline
Registered User
 
Join Date: May 2008
Location: Mexico City
Age: 49
Posts: 43
linuxfirefox
Re: Sun JDK Install Quesiton

I still don't have it working
__________________
Thanks in advance for your valuable help
Best regards: Marco A. Rios - Mexico City
Acer ASPIRE 2920 | Intel® Core™2 Duo CPU T7300 @ 2.00GHz × 2 (64-bit) | Graphics: Intel® 965GM | RAM=2GB
Reply With Quote
  #8  
Old 25th March 2013, 07:28 PM
obsidiana Offline
Registered User
 
Join Date: May 2008
Location: Mexico City
Age: 49
Posts: 43
linuxfirefox
Re: Sun JDK Install Quesiton

Please, I still have not working Java in my system, there are a lot of very important things I cannot do, can someone help me?

"Java" doesn't appear as an "application to open" the programs I need, for example XMind and ArgoUML.
__________________
Thanks in advance for your valuable help
Best regards: Marco A. Rios - Mexico City
Acer ASPIRE 2920 | Intel® Core™2 Duo CPU T7300 @ 2.00GHz × 2 (64-bit) | Graphics: Intel® 965GM | RAM=2GB

Last edited by obsidiana; 25th March 2013 at 08:46 PM.
Reply With Quote
  #9  
Old 25th March 2013, 07:31 PM
nonamedotc's Avatar
nonamedotc Offline
Formerly known as"professorrmd"
 
Join Date: Mar 2011
Posts: 2,627
linuxfedorafirefox
Re: Sun JDK Install Quesiton

Did you try using openJDK and see if your programs work?

This is the package name - java-1.7.0-openjdk.x86_64.
__________________
Fedora 18 x86_64 XFCE - Thinkpad T520 | Intel Core i7 - 2630 QM | NVIDIA NVS 4200m | 16 GB RAM | 500 GB HDD |
Fedora 19 x86_64 XFCE - Thinkpad T500 | Intel Core2Duo P8800 | 6 GB RAM | 500 GB HDD |


The Linux Documentation Project
Reply With Quote
  #10  
Old 25th March 2013, 07:38 PM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 4,979
linuxfirefox
Re: Sun JDK Install Quesiton

Rather than the ifnot true line, try the mjmwired guide (linked at the top of the page among the setup guides. )

http://www.mjmwired.net/resources/mj...-f18.html#java

That has always worked for me
Reply With Quote
  #11  
Old 25th March 2013, 07:42 PM
PabloTwo's Avatar
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,126
linuxfirefox
Re: Sun JDK Install Quesiton

Although this guide is for installing Oracle's jre in F17, it can be adapted to install the jdk package. Perhaps it can help you.
Reply With Quote
  #12  
Old 25th March 2013, 09:06 PM
ppesci's Avatar
ppesci Offline
Registered User
 
Join Date: May 2006
Location: Caracas, Venezuela
Posts: 1,828
linuxchrome
Re: Sun JDK Install Quesiton

Obsidiana:

All apear to be good.


Get a console or terminal and go to directory wher .jar file is:

example:

cd /home/obsidiana/whatever

Then type:

java -jar whateverfile.jar

Tell us if it works

If you want to see what java are you using try:

java --version

HTH
__________________
Pietro Pesci Feltri

PowerBook 15" G4 and
MacBook Pro 17" Intel Core 2 Duo
Intel I5 Desktop
Reply With Quote
  #13  
Old 26th March 2013, 06:31 AM
obsidiana Offline
Registered User
 
Join Date: May 2008
Location: Mexico City
Age: 49
Posts: 43
linuxfirefox
Re: Sun JDK Install Quesiton

Thanks to you, all,
I have no "jar" file, the file used to startup the application is named "XMind" with no extension
when I try to open file, it appears an error message indicating it doesn't exist an installed application for the file(s) "executable"

---------- Post added at 03:16 PM ---------- Previous post was at 03:04 PM ----------

I have Eclipse running and the following java program is selected:
/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
(obtained with the
alternatives --config java
command
whenever I select another program, "Eclipse fails to start

---------- Post added at 11:31 PM ---------- Previous post was at 03:16 PM ----------

Quote:
Originally Posted by smr54 View Post
Rather than the ifnot true line, try the mjmwired guide (linked at the top of the page among the setup guides. )

http://www.mjmwired.net/resources/mj...-f18.html#java

That has always worked for me
Thanks,
I have followed the tutorial, and now I have installed the newest java runtime, I have selected it (option 5)
But still, my Fedore doesn't recognize Java programs.
I even don't see an option in Nautilus to associate Java with the file
__________________
Thanks in advance for your valuable help
Best regards: Marco A. Rios - Mexico City
Acer ASPIRE 2920 | Intel® Core™2 Duo CPU T7300 @ 2.00GHz × 2 (64-bit) | Graphics: Intel® 965GM | RAM=2GB
Reply With Quote
  #14  
Old 26th March 2013, 08:01 AM
marko's Avatar
marko Offline
Registered User
 
Join Date: Jun 2004
Location: Laurel, MD USA
Posts: 5,449
linuxfirefox
Re: Sun JDK Install Quesiton

You can click on a jar file in your file manager, then from its menu, there should be a "Open With..." entry. Select that and type into the form "java -jar" and it will associate *.jar files with "java -jar" . From that point clicking on a jar file, for example "xyz.jar" will run:
Quote:
java -jar xyz.jar
I got that to work in KDE with Dolphin File manager. But one problem with that is that it won't pass any special arguments to the main class. Usually java apps use a front end script (named "runprogram" in my example below) to give you a place to add and edit the arguments, then it runs something like:

Quote:
#!/bin/sh
# runprogram

# DEBUG=0
DEBUG=1

JAVA="${JAVA_HOME}/bin/java"
exec "${JAVA}" -jar program.jar "${DEBUG}" "$@"
by running "runprogram argument1 argument2"

So just clicking on "program.jar" in the file manager would not have a way to correctly pass the option "DEBUG" nor the arguments lined up in "$@" which here would be "argument1 argument2". But sometimes all you need is: java -jar filename.jar so that would be fine

Last edited by marko; 26th March 2013 at 09:03 AM.
Reply With Quote
  #15  
Old 26th March 2013, 08:34 AM
ocratato Offline
Registered User
 
Join Date: Oct 2010
Location: Canberra
Posts: 551
linuxfirefox
Re: Sun JDK Install Quesiton

Probably the XMind object is a shell script that sets up and runs the java stuff.

If you can run:
Code:
file XMind
in the directory containing it and post the results here we might be better able to assist.
__________________
Don't tell me "The sky is the limit" when there are footprints on the moon.
Reply With Quote
Reply

Tags
install, jdk, quesiton, sun

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick quesiton about booting a few systems hybrid2000 Using Fedora 3 22nd February 2009 05:26 AM
Software quesiton Logitechcam Using Fedora 1 3rd July 2007 05:55 PM
another flash player quesiton.. Goldy3311 Using Fedora 3 18th February 2006 05:34 PM
Yum repository quesiton satimis Using Fedora 31 29th April 2005 11:15 AM
Memory Quesiton renato Using Fedora 6 27th May 2004 06:59 AM


Current GMT-time: 07:40 (Friday, 24-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat