LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 07-03-2006, 09:59 AM   #1
Azalar
Member
 
Registered: Jan 2006
Distribution: Ubuntu
Posts: 42

Rep: Reputation: 15
Java Install Problems


Hi
I recently purchased a server with Fedora Core 4 on it and i am having a few problems with Java on it.
I come from a Debian background and have used apt-get before so am not really familiar with Fedora at all.
The problems i am having is this..

I first noticed that the Java compiler that is installed as a default is not the Sun one and same for the JVM. I think it was Eclipse compiler and GIJ.
Preferring to use the standard Java i proceeded to try uninstall the standard Java on there so i could install the binary for J2EE for Linux.
Thats where the problems started.
I think i may have screwed things up and am not really confident about fixing dependency problems to sort this out.
When i try run the standard javac that is now installed i get a segmentation fault error.
And when i try the standard Java it has trouble locating the VM.

Could anyone advice me firstly how to clean Java out of my system and then install it properly in a way that will work nicely on Fedora, the version i want to install is J2EE
Any help that anyone can give will be greatly appreciated

Thanks
Az
 
Old 07-03-2006, 01:31 PM   #2
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
First use yum and reinstall the default java packages, when done try the following;

Reconfiguring FC4's default Java configuration

This is done as root or equivalent.

First remove /var/lib/alternatives/java file by typing;

rm /var/lib/alternatives/java

When asked press the 'y' key,

Now to create the new (corrected) alternatives file for java type
the following commands as root (modify for jdk as needed);

/usr/sbin/alternatives --install /usr/bin/java java /usr/lib/jvm/jre-1.4.2-gcj/bin/java 1

/usr/sbin/alternatives --install /usr/bin/java java /usr/java/j2re1.5.0_06/bin/java 2

/usr/sbin/alternatives --config java

You should now see for example:

There are 2 programs which provide 'java'.

Selection Command
-----------------------------------------------
1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
*+ 2 /usr/java/j2re1.5.0_06/bin/java

Enter to keep the current selection[+], or type selection number:

Type: <choose 1 or 2>

In the example above java is already configured correctly [*+ 2] to
use Sun's Java, no changes are needed, just press the Enter key here.
If you have been following the instructions then you should have
the same results (version numbers may be sightly different).

Now type; /usr/sbin/alternatives --display java

You should see for example;

java - status is manual.
link currently points to /usr/java/j2re1.5.0_06/bin/java
/usr/lib/jvm/jre-1.4.2-gcj/bin/java - priority 1
/usr/java/j2re1.5.0_06/bin/java - priority 2
Current `best' version is /usr/java/j2re1.5.0_06/bin/java.

Next you might want to create (or edit) /etc/profile.d/java.sh
file, example below;

export JAVA_HOME="/usr/java/jre1.5.0_06/bin"
export JAVA_PATH="$JAVA_HOME"
export PATH="$PATH:$JAVA_HOME"

When done creating or editing the file type;

source /etc/profile.d/java.sh

Now any user root or other wise should be able to use the command;

which java

and the results should read something like;

/usr/java/jre1.5.0_06/bin/java

Also any user root or other wize should be able to use the command;

java -version

and the results should read something like;

java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)


That's it, all done.
 
Old 07-03-2006, 03:18 PM   #3
Azalar
Member
 
Registered: Jan 2006
Distribution: Ubuntu
Posts: 42

Original Poster
Rep: Reputation: 15
Firstly, thank you for posting such a detailed reply.
I mentioned though that i need to get the J2EE version of Java installed not just the standard edition.
How would what you have described differ for getting the enterprise edition installed rather the standard?

thanks

Az
 
Old 07-03-2006, 09:13 PM   #4
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
J2EE and the standard pathing are basically the same so just the minor changes to reflect the different locations are all the should be needed.
 
Old 07-04-2006, 03:50 AM   #5
Azalar
Member
 
Registered: Jan 2006
Distribution: Ubuntu
Posts: 42

Original Poster
Rep: Reputation: 15
What i didn't understand from your first post is at what stage would i install Suns Java?
I dont want the default Java on there because if i understand this correctly Gij compiles to binary and therefore wouldnt be portable which is useless.
I dont want the default Java installation that comes with Fedora i just want Suns J2EE to work on it.

thanks

Az
 
Old 07-04-2006, 04:48 AM   #6
Azalar
Member
 
Registered: Jan 2006
Distribution: Ubuntu
Posts: 42

Original Poster
Rep: Reputation: 15
I started to go through your instructions but fell at the first part.
I removed the alternative java file and when i tried creating the new link it says..

failed to link /usr/bin/java/ -> /etc/alternatives/java: File exists

Then i looked into the directory listing and it has many references to Java stuff..

--> ls /var/lib/alternatives/
antlr java_sdk_1.4.2 jaxp_transform_impl jre_gcj
hibernate_jdbc_cache java_sdk_gcj jmxri mta
javac jaxp_parser_impl jre_1.4.2 print
 
Old 07-04-2006, 06:18 AM   #7
Azalar
Member
 
Registered: Jan 2006
Distribution: Ubuntu
Posts: 42

Original Poster
Rep: Reputation: 15
I requested that they reinstall the server back to its default settings so that i have a clean install to start with.
So what i have now as a default is the Eclipse compiler and Gij jvm.
Do these support and include J2EE as a default?
I want to now go from this default install to having a working J2EE install that works fully with Fedora.
Can anyone advise how to do this please?

thanks

Az
 
Old 07-04-2006, 06:19 AM   #8
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
First, sorry about that, you can install Sun's Java after installing the default java stuff for FC5.

Quote:
Then i looked into the directory listing and it has many references to Java stuff..

--> ls /var/lib/alternatives/
antlr java_sdk_1.4.2 jaxp_transform_impl jre_gcj
hibernate_jdbc_cache java_sdk_gcj jmxri mta
javac jaxp_parser_impl jre_1.4.2 print
To be expected, this is part of the modifications or adjustments that you need to make. I wrote the detailed description awhile ago (when FC3 came out) and have not updated it.

Both can co-exist without any problems, instructions for installing Java in FC5 can be found here (remember you need to adjust this for J2EE);

http://www.fedorafaq.org/#java
 
Old 07-04-2006, 08:04 AM   #9
Azalar
Member
 
Registered: Jan 2006
Distribution: Ubuntu
Posts: 42

Original Poster
Rep: Reputation: 15
So it is safe to leave gij and eclipse on the server and install J2EE around it? There wont be any conflicts?
 
Old 07-04-2006, 08:11 AM   #10
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
Quote:
Originally Posted by Azalar
So it is safe to leave gij and eclipse on the server and install J2EE around it?
Yes, J2EE should be set as the current 'best' default version of Java.

Quote:
There wont be any conflicts?
Normally no, cannot guarantee against bad code however.
 
Old 07-06-2006, 06:16 PM   #11
Azalar
Member
 
Registered: Jan 2006
Distribution: Ubuntu
Posts: 42

Original Poster
Rep: Reputation: 15
Tried to do this but it doesnt work.
The instructions on the JPackage site don't work with the J2EE version because they don't specifically have an RPM for J2EE
 
Old 07-07-2006, 06:06 AM   #12
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
From where the downloaded bin file is; chmod +x the_file_name_here
As root or equivalent; ./the_file_name_here

Additional help; http://docs.sun.com/app/docs/doc/819...5s4p42j?a=view
 
Old 07-07-2006, 06:44 AM   #13
Azalar
Member
 
Registered: Jan 2006
Distribution: Ubuntu
Posts: 42

Original Poster
Rep: Reputation: 15
I installed the bin files and set up some alternatives and from what i can see it is working now but i didnt do any of the stuff at the JPackage site so i hope it will be ok
Im suprised this has been so problematic to setup i would have thought most developers would want the J2EE version more than J2SE.
 
  


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
make-jpkg (java install) problems powadha Debian 4 06-06-2010 06:17 AM
Having Install Problems With JAVA RE2, MPLAYER, and FIREFOX axess_denied Linux - Software 2 11-22-2004 06:43 PM
Install problems with Java plugin on Mozilla 1.6 rickshoop Linux - Software 1 06-15-2004 05:51 PM
java install problems have read postings mandrake 9.1 tewaru Linux - Newbie 3 05-07-2004 02:26 AM
java and flashplayer install problems on Mandrake 9.1 gasfrog Linux - Newbie 14 07-20-2003 06:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 09:19 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