Fedora This forum is for the discussion of the Fedora Project. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-03-2006, 09:59 AM
|
#1
|
Member
Registered: Jan 2006
Distribution: Ubuntu
Posts: 42
Rep:
|
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
|
|
|
07-03-2006, 01:31 PM
|
#2
|
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:
|
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.
|
|
|
07-03-2006, 03:18 PM
|
#3
|
Member
Registered: Jan 2006
Distribution: Ubuntu
Posts: 42
Original Poster
Rep:
|
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
|
|
|
07-03-2006, 09:13 PM
|
#4
|
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:
|
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.
|
|
|
07-04-2006, 03:50 AM
|
#5
|
Member
Registered: Jan 2006
Distribution: Ubuntu
Posts: 42
Original Poster
Rep:
|
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
|
|
|
07-04-2006, 04:48 AM
|
#6
|
Member
Registered: Jan 2006
Distribution: Ubuntu
Posts: 42
Original Poster
Rep:
|
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
|
|
|
07-04-2006, 06:18 AM
|
#7
|
Member
Registered: Jan 2006
Distribution: Ubuntu
Posts: 42
Original Poster
Rep:
|
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
|
|
|
07-04-2006, 06:19 AM
|
#8
|
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:
|
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
|
|
|
07-04-2006, 08:04 AM
|
#9
|
Member
Registered: Jan 2006
Distribution: Ubuntu
Posts: 42
Original Poster
Rep:
|
So it is safe to leave gij and eclipse on the server and install J2EE around it? There wont be any conflicts?
|
|
|
07-04-2006, 08:11 AM
|
#10
|
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:
|
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.
|
|
|
07-06-2006, 06:16 PM
|
#11
|
Member
Registered: Jan 2006
Distribution: Ubuntu
Posts: 42
Original Poster
Rep:
|
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
|
|
|
07-07-2006, 06:06 AM
|
#12
|
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:
|
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
|
|
|
07-07-2006, 06:44 AM
|
#13
|
Member
Registered: Jan 2006
Distribution: Ubuntu
Posts: 42
Original Poster
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 09:19 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|