LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Installing Java SDK... (http://www.linuxquestions.org/questions/linux-newbie-8/installing-java-sdk-758560/)

Kris Jacyna 09-29-2009 08:33 PM

Installing Java SDK...
 
Hey guys, im new to linux and java for that mattter. I am studying computer science at university and we are using linux fedora 10.

I have downloaded and installed this version of linux at home.
Could someone please help me with instructions on how to insall java?
(eg. so i can compile programs in command line. "javac......etc")
i am having great difficulty with trying to do this. I have downloaded the latest version of the Java EE 6 SDK from the sun website but when i try to install it, it throws up the message:

java_ee_sdk-5_07-jdk-6u16-linux.bin: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

So then i searched the net and downloaded the file:
compat-libstdc++-33-3.2.3-64.i386.rpm
(which people seemed to say would fix this issue)

But when i try to install this file, it says "Cannot execute binary file"

If someone could help me id be so grateful as it is getting extremely frustrating now lol.

Thanks in advance,
Kris

lutusp 09-29-2009 08:52 PM

Quote:

Originally Posted by Kris Jacyna (Post 3701194)
Hey guys, im new to linux and java for that mattter. I am studying computer science at university and we are using linux fedora 10.

I have downloaded and installed this version of linux at home.
Could someone please help me with instructions on how to insall java?
(eg. so i can compile programs in command line. "javac......etc")
i am having great difficulty with trying to do this. I have downloaded the latest version of the Java EE 6 SDK from the sun website but when i try to install it, it throws up the message:

java_ee_sdk-5_07-jdk-6u16-linux.bin: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

So then i searched the net and downloaded the file:
compat-libstdc++-33-3.2.3-64.i386.rpm
(which people seemed to say would fix this issue)

But when i try to install this file, it says "Cannot execute binary file"

If someone could help me id be so grateful as it is getting extremely frustrating now lol.

Thanks in advance,
Kris

Why not install the requred library using a package manager? Doing it this way assures you get the right version of the library and any dependencies.

Code:

# yum install libstdc++
Then you can install Java.

parkercombes 09-30-2009 08:14 AM

I agree with the above post, but I thought I'd provide a little more info if you want it, since you're new. Fedora/Red Hat packages are *.rpm files. Other distributions like Debian/Ubuntu have other package names i.e. *.deb. For the .bin file you have please look at this post

Kris Jacyna 09-30-2009 05:29 PM

Thanks for the response guys. I ran the code that lutusp suggested and it ran through a few things, but finished up by saying "nothing to do".
I tried to install the java file i have again but still throws up the same error as before.

The file i am trying to install is named:
java_ee_sdk-5_07-jdk-6u16-linux.bin

When i try to install this file i am following the instructions shown in the thread that parkercombes posted the link to.

Any ideas on what steps to take next?

thomas.hedden 09-30-2009 09:25 PM

Hello Kris,

> ... fedora 10 ...
> Could someone please help me with instructions on how to install java?
> ... error while loading shared libraries: libstdc++.so.5: ...
First, I strongly agree with lutusp ...
> Why not install the required library using a package manager?
Many programs have dependencies that have other dependencies, etc., and
these dependencies are all worked out if the programs are installed via
a package manager. If you try to install program A without program B,
but program B is required for program A to work, then the package manager
will tell you so, and ask you whether you want to install program B, too.

For Fedora 11 (and probably 10 as well), this can be done through the
menu commands: System | Administration | Add/Remove Software
There is also the command-line tool "yum".

I assume that you installed the basic development packages when you
installed Fedora. If not, then do so. Then, search for what is
missing (libstdc++.so.5) in "Add/Remove Software": This should find
what you need to install.

> # yum install libstdc++
I think that the reason why this didn't help is because your
libstdc++ library is up-to-date, in fact MORE up-to-date than
what is required for what you want to do. I seem to recall
that the problem that you are having is that your system has a
LATER version of the library installed than the one required for
the program you want to install, but the program you want to
install won't accept this later version. If memory serves, in this
case you can also install the older "compatibility" version.

Unless you're already a whiz at using RPMs, I would abandon that
approach and just follow the steps I outlined above.

I also strongly recommend regularly updating your system, so that
things don't get so far out of date that they can't be updated
anymore.

Let me know if you still can't get it to work.

Best regards,

Tom

hilel14 10-01-2009 01:08 AM

RE: Installing Java SDK...
 
Quote:

Originally Posted by Kris Jacyna (Post 3702443)
Thanks for the response guys. I ran the code that lutusp suggested and it ran through a few things, but finished up by saying "nothing to do".
I tried to install the java file i have again but still throws up the same error as before.

The file i am trying to install is named:
java_ee_sdk-5_07-jdk-6u16-linux.bin

When i try to install this file i am following the instructions shown in the thread that parkercombes posted the link to.

Any ideas on what steps to take next?


First, the command you are looking for is
yum install compat-libstdc++-33

Second, unless you need some Java EE specific features, you can install the Java Developer Kit - Standard Edition. You can see what java packages are available for you with this command:

yum list *openjdk*

On my Fedora 11, for example, I have this one installed:

java-1.6.0-openjdk-devel

I Also recommend installing NetBeans using yum repository. the only thing you have to install manually is GlassFish.

lutusp 10-01-2009 01:37 AM

Quote:

Originally Posted by Kris Jacyna (Post 3702443)
Thanks for the response guys. I ran the code that lutusp suggested and it ran through a few things, but finished up by saying "nothing to do".
I tried to install the java file i have again but still throws up the same error as before.

The file i am trying to install is named:
java_ee_sdk-5_07-jdk-6u16-linux.bin

When i try to install this file i am following the instructions shown in the thread that parkercombes posted the link to.

Any ideas on what steps to take next?

Quote:

it ran through a few things, but finished up by saying "nothing to do".
This means you already have the required library installed UNLESS you have been deleting libraries randomly. Try reinstalling the compiler libraries:

Code:

# yum reinstall libstdc++
This is normally a trouble-free installation. I have never heard of a case like this, and I develop Java programs regularly.

The bottom line is that there is something wrong with your system's configuration -- it's missing something essential.

thomas.hedden 10-01-2009 07:25 AM

lutusp wrote:
> This means you already have the required library
> installed UNLESS you have been deleting libraries
> randomly. Try reinstalling the compiler libraries:
> # yum reinstall libstdc++[/CODE]
> The bottom line is that there is something wrong
> with your system's configuration -- it's missing
> something essential.
I don't think so. See my post. I think that the
problem is that the libraries are installed, but
that their version is LATER than the one required,
and the SDK is demanding an EARLIER version. This
is why the usual yum installation isn't helping.
It's working fine, but that's not the problem.

I haven't checked it, but the suggestion by hilel14
might accomplish what you need to do, however, I do
want to emphasize that this is not the last time
you will encounter problems of this type, and that
you should learn how to pinpoint problems of this
type on your own. Instead of simply issuing the
command and forgetting about all this, I still
strongly suggest that you pursue the matter through
the graphical package manager:
System | Administration | Add/Remove Software
If you search for libstdc++ without version number,
you might very well see both versions so that you
can verify what I'm saying. Look at the version
you have installed, and see what files it contains.
I'll bet it contains the file "libstdc++.so.6"
(ending in ".6" instead of ".5"). If you look at
the older versions of this library, I think you'll
find that there is one that contains the file you
need, namely "libstdc++.so.5".

Another easy thing you try to verify this is to
search your computer for the file(s) in question.
Try issuing this command:
$ find / -name libstdc++.so.6 -print 2>/dev/null
I'll bet this command returns something like:
/usr/lib/libstdc++.so.6
That will show that you have a later version of the
library installed than the one you need.

Please let me know if you don't get it working.

Best regards,

Tom

reg.doug 10-01-2009 07:29 AM

Quote:

Originally Posted by Kris Jacyna (Post 3701194)
So then i searched the net and downloaded the file:
compat-libstdc++-33-3.2.3-64.i386.rpm
(which people seemed to say would fix this issue)

But when i try to install this file, it says "Cannot execute binary file"

RPMs are not binary files. You install them with the command
Code:

# rpm -i `rpm_name`
As other people have noted, using yum is preferrable, but you could try this if nothing else works.

thomas.hedden 10-01-2009 07:31 AM

P.S.
> ... libstdc++ ... version ...
> ... "libstdc++.so.6" ... "libstdc++.so.5".
In this case, I'm pretty sure that you can
have both versions installed. Just go ahead
and install the old one in addition to the
one that you have installed, and do so
through the package manager. It will complain
at you if you should not do this for some reason.

Best regards,

Tom

thomas.hedden 10-01-2009 02:21 PM

reg.doug wrote:
> RPMs are not binary files.
> You install them with the command ...
I think that what you mean to say is
that RPMS are not EXECUTABLE files.
They are in fact binary files. If you
open a terminal window and type ...
$ head RPM_PACKAGE_NAME.rpm
... you'll see that this is true.
Tom

reg.doug 10-02-2009 07:06 AM

Tom

you are right -- binary wasn't what I mean't to say

Thanks for the correction :D

Kris Jacyna 10-03-2009 05:49 PM

Hey people!
Thank you all so much for your help and it worked. I managed to install the correct files from the software manager and Java EE installed no problems.

Thanks again,

Kris.


All times are GMT -5. The time now is 08:34 AM.