• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 217
  • Last Modified:

Why JAVA Installation should be a nightmare?

Hello Java Experts,

It is about 2 days I'm asking questions on how to install JAVA. However, I cannot get any straight  or easy solution!!!!!!!!
All I'm going to do is installing JDK in Linux (Redhat Enterpise Editoin 5).
 I was wondering if you have installed Java in Linux. Just to give you some information about my situation.

I did download JAVA SE first then I installed JDK1.1.7; now when I run:


# javac Example.java

/usr/lib/jdk1.1.7/bin/../bin/i686/green_threads/javac: line 30: 12032 Segmentation fault      `dirname $0`/${progname}${progsuffix} $RUNTIME_ARGS -ms8m $RUNTIME_ARGS sun.tools.javac.Main $APP_ARGS

My question is why there is NO a solid or simple way to install Java in Linux? if there is what is it then?!
Should I set the environment variable myself or the installation is smart engouh? if not then how?


After JDK installation I did install:   yum install openmotiff as one of the admins advised but no luck yet.

I will appreciate it if you could help me.

Thanks,
ak

p.s. please don't tell me this is easy go to that website only.  What I need is a solution to install JDK only

0
akohan
Asked:
akohan
  • 13
  • 6
  • 3
  • +1
1 Solution
 
mohammedfCommented:
there is a solid and easy way to install Java on linux dont worry
just see this article
http://java.sun.com/j2se/1.4.2/install-linux.html

0
 
akohanAuthor Commented:

Thanks for your response but this is j2se I need jdk. do i need j2se for programming or jdk?!!

Regards,
ak
0
 
akohanAuthor Commented:

btw, it doesn't say from where I can get it.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
mohammedfCommented:
u need J2SE ,, this means JDK they are alomst the same
0
 
cmalakarCommented:
0
 
cmalakarCommented:
Lets say u have installed java in /usr/java/

Then put the bin directory of jdk installation in path..

and run "javac" and "java" commands
0
 
akohanAuthor Commented:


amzaing that it doesn't work: This is what I get:

"Product Not Found
The product you requested is not available at this time.
If you require further assistance, report the product name and referring URL to Customer Service.
Thank you."


Any idea?

0
 
cmalakarCommented:
Is my url.. giving this error.. ? It is working fine for me..

Other way..
Go to..
http://www.java.com/en/download/manual.jsp

Download the link.. named as.. "Linux (self-extracting file)  filesize: 18.23 MB"
0
 
gnoonCommented:
1. Download the lastest version of Java from here http://java.sun.com/javase/downloads/index.jsp for your linux (choose RPM file).
    You shall get installer of JDK with JRE included. Use JDK to develope program. JRE will be used by user (you're a user too).
2. Login as root
3. Change to the directory where the file is located
4. Run chmod a+x jdk-<file spec>-rpm.bin
5. Run ./jdk-<file spec>-rpm.bin
6. Run rpm -iv jdk-<file spec>.rpm
7. Now you can delete the bin and rpm files
8. Now java is installed, you may need to add the bin path to the start up script. So you can run javac on shell instead of using fullpath, /usr/lib/jdk/bin/javac for example.
    Add these lines to your start up script, which could be global script or your profile script (.bash_profile).

    JAVA_HOME=your jdk directory e.g. /usr/lib/jdk
    export JAVA_HOME
    export PATH=$JAVA_HOME/bin:$PATH
0
 
akohanAuthor Commented:

Thank you so much for the details. The thing is that I already had installed and it is strange that javac is located under a path as:
/usr/lib/jdk1.1.7/bin/i686/green_threads/javac

so whe I run:

# /usr/lib/jdk1.1.7/bin/i686/green_threads/javac /root/Example.java

I get this message:
/usr/lib/jdk1.1.7/bin/i686/green_threads/java_ns: error while loading shared libraries: libjava.so: cannot open shared object file: No such file or directory

it seems I'm missing some libraries like libjava.so

how can I uninstall it and go with your method?

Regards,
ak

0
 
akohanAuthor Commented:

Or at least how to fix this missing library?

0
 
akohanAuthor Commented:


Anybody knows how I can remove Java from my machine? it seems there is solution to this.
I will appreciate it.


Thanks,
ak
0
 
gnoonCommented:
Try to run

ln -s / /cow

before compile. http://ubuntuforums.org/showpost.php?p=1947183&postcount=12
0
 
akohanAuthor Commented:

What is this?! I have no idea this is for removing or fixing the problem!?
0
 
akohanAuthor Commented:


If you guys don't mind I'm going to close this thread because if I accept an answer, I guess it might not be helpful for future readers
Thanks for every indvidual here who helped me.

Regards,
ak

0
 
gnoonCommented:
>What is this?! I have no idea this is for removing or fixing the problem!?
It's not removing. The command may help to fix the broken path to java libraries.

>If you guys don't mind I'm going to close this thread
Up to you guy :-)
0
 
akohanAuthor Commented:

Thanks indeed. I tried the comment but didn't work.

Regards,
ak
0
 
cmalakarCommented:
Why are trying the jdk1.1.7, the very old version of java...

Why not the latest.. version...

And more over, how did you installed jdk1.1.7  ?
0
 
cmalakarCommented:
>> I'm going to close this thread because if I accept an answer, I guess it might not be helpful for future readers

Why..?

With My Comment ID:20839199, you can easily install the latest version of java...
0
 
akohanAuthor Commented:


The issue is not the source or where I have to get the package but how to install and set it up in Linux.  I personally don't have any problem with assinging the credit to you or any other expert who has responded me but it just didn't work. Please let me know if you have any suggestions.

Thanks,
ak
0
 
akohanAuthor Commented:

Regarding your qeustion on how I installed it:
1) I used the RPM to install.
2) after installation when I use javac progname.java

it won't compile and would come up with errors as following:

usr/lib/jdk1.1.7/bin/../bin/i686/green_threads/javac: line 30: 12032 Segmentation fault      `dirname $0`/${progname}${progsuffix} $RUNTIME_ARGS -ms8m $RUNTIME_ARGS sun.tools.javac.Main $APP_ARGS

Thanks,
ak
0
 
cmalakarCommented:
Java version i have suggested is java1.6...

and you are using jdk1.1.7 which is very old...

Please let me know, in which directory you have installed java 1.6..

I will help you in compiling and running java programs..
0
 
akohanAuthor Commented:

Finally. Yes, you are right. a friend of mine gave me jdk with the same version as you have pointed out and I installed it on top of the previous one (pretty a mass but didn't have any choice). The good thing is that now I can run javac !!!!

Amazing that java can work in linux....................................

I tried to remove the previous one but almost impossible. I have asked tens of persons and no luck. Anyway since I'm in the middle of something I guess have to go with current setting.

Now, questions:

What url can I get his jdk 1.6 in case for future?

Thanks,
ak



0
 
akohanAuthor Commented:

I forgot to tell that the link you sent still says no product; that's why I'm asking if there is a better URL.

0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 13
  • 6
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now