Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Enabling Java

  1. #1
    Bogler
    Guest

    Enabling Java

    I have installed 7.3 and downloaded the j2re rpm.bin (for Linux)file from sun.

    I take it that this must be installed before i will get full Java functionality.

    What else if anything should i be installing/configuring to enjoy java on my box? I would like to be able to start developing my own apps eventually..

    Apologies if this has been discussed before..

    Also, for those of you ruuning oss on RH7.3 you'll have to download the kernel-source and recompile the oss drivers.

    regards

    Bogler 8)

  2. #2
    JimH
    Guest

    Re:Enabling Java

    You have to extract the rpm from the .bin file first.

    chmod a+x j2sdk-1_4_0-linux-i386-rpm.bin
    ./2sdk-1_4_0-linux-i386-rpm.bin

    The just install the rpm:

    rpm -Uvh j2sdk-1_4_0-fcs-linux-i386.rpm

    I put this in another thread on the board, but I changed the way I was doing it. The so you don't have to use the full path to java:

    Create the file /etc/profile.d/java.sh
    Copy this to into the file:

    #Begin /etc/profile.d/java.sh
    #Set JAVA_HOME and path

    JAVA_HOME="/usr/java/j2sdk1.4.0"

    if ! echo $PATH | /bin/grep -q "$JAVA_HOME/bin" ; then
    PATH="$PATH:$JAVA_HOME/bin"
    fi

    export JAVA_HOME

    #End /etc/profile.d/java.sh

    If you install Java in a different place just change JAVA_HOME. Make sure the java.sh has the right permissions.

    chown root.root /etc/profile.d/java.sh
    chmod 0755 /etc/profile.d/java.sh

    For the changes to take effect, logout and login or you can use: source /etc/profile

    If you did it right:

    $ echo $PATH
    /usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/java/j2sdk1.4.0/bin:/home/jimh/bin

    $ env | grep JAVA_HOME
    JAVA_HOME=/usr/java/j2sdk1.4.0


    You can just add the same to ~/.bash_profile I prefer to use /etc/profile.d because you only have to add it once and it is setup for all users.

    Jim H

  3. #3
    Bogler
    Guest

    Re:Enabling Java

    Thanks JimH

    I managed to get som instructions on the sun site but you help is invaluable as ever.

    Bogler

    ;D

  4. #4
    Bogler
    Guest

    Re:Enabling Java

    What's the difference between the

    jdk and j2re packages?

    I take it one is the development libraries and the other is the runtime.

    Should i have both of these installed for best performance/usability?

    Thanks

    Bogler

  5. #5
    JimH
    Guest

    Re:Enabling Java

    The jdk is required if you are going to be writing java programs. The jdk includes the jre.

    If you just want to run java programs and applets then you only need the jre. The jre is quite a bit smaller download then the jdk so if you won't be writing java programs just download the jre.

    Jim H

  6. #6
    Bogler
    Guest

    Re:Enabling Java

    I tried the above script but i couldn't get it to work.
    It keeps saying
    bash: command not found

    When i delete the java.sh file this error dissapears. If i have the suggested java.sh file in place it doesn't add the java entry to the PATH variable.

    I cut and paste the script and have been through it line by line. Can't see what's wrong with it.

    Thanks for any help

    Bogler

  7. #7
    JimH
    Guest

    Re:Enabling Java

    Hmmm, you are doing something wrong. Try copying it by hand instead of copying and pasting it. You might be picking up an "invisible" character that is messing everything up.

    Don't use the same file to edit it by hand. Delete the one you have and start again.




  8. #8
    Bogler
    Guest

    Re:Enabling Java

    I think i have it now 8)

    Thanks again

    Bogler

  9. #9
    JimH
    Guest

    Re:Enabling Java

    Quote Originally Posted by Bogler
    I think i have it now 8)
    What was the problem?

    Jim H

  10. #10
    Bogler
    Guest

    Re:Enabling Java

    I reckon it must have been an invisible char.

    BTW can you use profile.d for other scripts i.e. to add to your PATH so that all your apps are accesssible from the cli at runtime. I would like the path to contain /usr/local/psionic for portsentry etc etc.

    Does the profile.d directory contain scripts that are run at boot and therefore has lots of mileage for manipulation..

    Bogler

Similar Threads

  1. Enabling php for directory in Apache
    By honey bee in forum Linux - General Topics
    Replies: 3
    Last Post: 09-27-2007, 01:30 PM
  2. Enabling CMOS/BIOS setup
    By Millermagic in forum Windows - General Topics
    Replies: 4
    Last Post: 02-06-2005, 09:58 PM
  3. java and opera... always says invalid java directory
    By sujoki in forum Linux - Software, Applications & Programming
    Replies: 0
    Last Post: 08-26-2003, 03:54 PM
  4. Enabling DMA for dvd
    By in forum Linux - General Topics
    Replies: 2
    Last Post: 09-02-2002, 02:17 AM
  5. Is enabling quotas different on Ext3 than Ext2?
    By tolstoy in forum Linux - General Topics
    Replies: 1
    Last Post: 03-19-2002, 03:29 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •