|
Register | FAQ | The Twelve Commandments | Members List | Calendar | Arcade | Find the Best VPN | Today's Posts | Search |
General Linux Support For questions regarding use of LimeWire or WireShare or related questions on the Linux operating system. This includes installation questions and answers. (Check the Stickies marked in Red at top of this section.) |
| LinkBack | Thread Tools | Display Modes |
| |||
Installing Java Installing Java on Linux seems to be a bit of a problem for newbies. Here are a few pointers that hopefully will make the installation a sucess. Before you do anything, read this whole post and make sure you understand it. First of all make sure you have a recent version of Linux as recomended by Sun. Read the installation guide and don't skip steps even if they seem useless. http://java.sun.com/j2se/1.4.1/jre/install-linux.html Download the latest version of Java from Sun. You have two choices rpm and bin either one works as long as you follow the exact directions in the installation guide. Here is the java download page: http://java.sun.com/j2se/1.4.1/download.html There are a couple of gotchas here. The bin installation is not too clear on the root access. For that reason alone newbies should use the rpm installation. When you do the rpm installation you first get a file with extension rpm.bin. This is a self extracting file that displays a license ageement and it prompts you to agree (type yes to the prompt) or not (type no). Before you self extract this file you must give it execute permission (chmod) as indicated in the first command of step 2 of the the installation guide. If you you fail to do so, you will not be able to execute the script. Do not attempt any shortcuts here or you may run into problems. Yes, the current directory ( ./ ) in front of a command is important in Linux so you do need it in the second command of step 2. Unlike WIndows, the current directory in Linux is not in the PATH so executables will not be found if ./ is not specified. After this step a file with extension rpm is created (if you ageed to the license). Step 3 indicates to loggin as root. You do this with the "su" command. Step 5 is done with the command "exit " I just can't say it enough: Follow the exact instructions in the guide. After you have succesfully installed Java, you need to make it accesible by modiying the PATH variable to include the java directory in the path. There a several way to do this. I prefer to make it a system wide change so I modify /etc/profile to have a line like this PATH=<javadirectory>:$PATH where <javadirectory> is where java executable got installed. The directory will be different according to the version you installed. To find out do this command: find /usr/ -name "*j2*" The find command will help you determine the directory that containts the Java installation. What you need is the subdirectory that contains the java executable. This subdirectory is "bin". Example: You found out that Java is in /usr/java/j2re-1.4.0_02 The java executable is in directory /usr/java/j2re-1.4.0_02/bin Thus you should change your profile to have this line: PATH=/usr/java/j2re-1.4.0_02/bin:$PATH Some Java applications look for a variable called JAVA_HOME. You might as well set this variable in the profile and combine it with the PATH change. Here is a way to setting up both the PATH and JAVA_HOME in our example where we assumed Java in /usr/java/j2re-1.4.0_02: Add these lines to the profile: JAVA_HOME=/usr/java/j2re-1.4.0_02 PATH=$JAVA_HOME/bin:$PATH export JAVA_HOME IMPORTANT Before you mess around editing /etc/profile make a copy of it. This way you could restore from the copy if necessary. To make a backup copy do cp /etc/profile /etc/profile.save Windows users note that the different paths in the $PATH variable are separated by a colon ( : ) unlike Windows. Also environment variable in Linux are referenced with a $ sign. Finally make sure you do your PATH and JAVA_HOME before the corresponding "export" commands in /etc/profile Once you do this change you must login as a user to see if the change and do echo $PATH echo $JAVA_HOME to verify that you have the right PATH and JAVA_HOME. If you do you will be able to do which java and get the directory that has java. If you get an error review your settings and try it again. Finally this command will tell you for sure if java is installed: java -version This should display the version of your java if not then review the steps and fix the problem. Good luck. Last edited by b4k4^ni; June 7th, 2003 at 05:45 AM. |
| |||
Big Problem I followed the instructions... When linux starts up and loads X-server, I type in my login and KDE trys to start, but it gets an error and logs back out. (for ALL users, even root). I try to log in on terminal, when I get in I can only run the cd command, all other commands I know (find, ls, cat, joe, vi, su, etc) aren't recognised. I think that screwed something up, because it's the only thing I changed...I can run all commands in rescue mode, but when I try to edit the profile file, it looks like it's unedited from before (no java path)...whats going on here? |
| |||
I don't know. What program did you use to edit the .profile file?
__________________ Morgens ess ich Cornflakes und abends ess ich Brot Und wenn ich lang genug gelebt hab, dann sterb ich und bin tot --Fischmob |
| |||
Sounds like you might have wiped the contents of the PATH variable. That's why you don't see the commands. Login as root from a text console (ALT+F2) and do this command: echo $PATH You should have at least these directories in the path: /bin:/usr/bin:/usr/X11R6/bin You need to edit /etc/profile and fix the assignment to the PATH variable. Make sure you use colon ( : ) as a separator. It is a common mistake for windows users to use simicolon instead. You can still invoke the commands by specifying the full path. Hopefully you know how to use the vi editor. If you do then just do /bin/vi /etc/profile fix the profile. Optimally your PATH should contain other directories including the direcotry for Java binaries. Before you edit any files it is a good practice to make a copy of the file just in case you need to restore it. |
| |||
If you need help you need to provide more information. What exactly do you mean with "java VM not recognized" ? Which directory did you install java in? find out with find / -name "*j2*" What is the PATH set to? find out with echo $PATH PS: It's good to hear you are up and running again. Last edited by b4k4^ni; June 7th, 2003 at 05:43 AM. |
| |||
when I try to run runLimeWire it still says I need to have java VM installed... my java dir. is /usr/java/j2re1.4.1_02 my PATH variable is /usr/java/j2re1.4.1_02:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/opt/kde2/bin:.:/usr/lib/java/bin:/opt/gnome/bin PS: thanks ^_^ |
| |||
CelestialLegends, you just mihgt have helped unlock one of the mysteries of tha java VM installation. Here is the scoop: Your Java installation directory is /usr/java/j2re1.4.1_02 However the java executable is in a subdirectory called "bin" in otherwords /usr/java/j2re1.4.1_02/bin so your PATH should be /usr/java/j2re1.4.1_02/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/opt/kde2/bin:.:/usr/lib/java/bin:/opt/gnome/bin Do the change then logout and login again for the profile to take effect. Check your PATH and do which java Should give you /usr/java/j2re1.4.1_02/bin/java Find out the version with: java -version You should be OK. Last edited by b4k4^ni; June 7th, 2003 at 05:42 AM. |
| |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
i need help; LW says please install the new version of java after installing Java | Logan_2468 | Windows | 7 | October 6th, 2009 12:07 AM |
Installing Java | humbertoarte | Windows | 5 | October 11th, 2006 10:25 AM |
Installing Java | m-life | Windows | 2 | March 5th, 2006 01:32 PM |
Installing Java | chunkin | General Linux Support | 1 | September 8th, 2003 01:29 PM |
Installing java | Unregistered | General Linux Support | 1 | March 3rd, 2002 05:29 AM |