LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Installing Java2 RE from .bin (https://www.linuxquestions.org/questions/linux-newbie-8/installing-java2-re-from-bin-33091/)

GT I.N.C 10-18-2002 02:31 AM

geeeez i forgot the -jar .....and umm java doesnt work now.....whys that...since i logged out....i havent touched profile or bash_profile yet...

Garry

MasterC 10-18-2002 02:35 AM

ha ha ha, that's the contents of your /bin directory rather than /usr/local/bin/java/bin

Ok, so, it would appear that the entry in /etc/profile isn't working for whatever reason.

Cool

GT I.N.C 10-18-2002 02:37 AM

Wrong bin folder sorry..
Code:

[root@localhost bin]# ls
ControlPanel*  java_vm*  kinit*  ktab*  policytool*  rmiregistry*  tnameserv*
java*          keytool*  klist*  orbd*  rmid*        servertool*


GT I.N.C 10-18-2002 02:38 AM

So would that mean i have to put it in my bash_profile one?
Yeh i just realised it while reading through the files in it hahaha...:)

Garry

GT I.N.C 10-18-2002 02:39 AM

I'm not sure if this will work i'm still a newbie, but can i make like a link to java in /usr/local/bin/java from /sbin or wherever program commands are installed...would that work?

Garry

MasterC 10-18-2002 02:44 AM

Some people do that, but I just dug up some good info I used to give, here's the page:
http://www.mandrakeuser.org/docs/utils/ujava.html

So follow this part of those instructions:
Quote:

Installing Java

I uninstalled kaffe as it's '/usr/bin/java' appears to conflict with J2SDK/J2RE. Although, I'll note here that the j2sdk*.rpm does not complain about kaffe when installing. Nor does the j2sdk*.rpm modify your .bashrc file! So onward we go:

1. Type su on a terminal and enter your 'root' password.
2. Uninstall kaffe: urpme kaffe
3. Make Java installer package executable: chmod a+x j2sdk-1_4_0-fcs-linux-i386.rpm.bin
4. Execute it: ./j2sdk-1_4_0-fcs-linux-i386.rpm.bin
5. Install it (as 'root'): urpmi j2sdk-1_4_0-fcs-linux-i386.rpm

Create a file called 'java.sh' as 'root' in '/etc/profile.d' containing these lines:

JAVA_HOME=/usr/java/j2sdk1.4.0
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH

Make it executable with

chmod +x /etc/profile.d/java.sh

From now on, both variables will be set in all newly opened shells or terminals.
If any of that doesn't make sense to you, I can explain them better.

To further answer your question about symlinking it...

Yes, people do it, and I have done it before, but I suggest trying to get it accomplished this way first rather, and resort to that as a last ditch effort.

BTW, I tried that program, it's kinda cool, but sorta very basic, especially compared to gimp or somthing like it. Java programs usually seem to hog resources and don't move very quickly.

Anyway, let's keep going because it's good to have java installed anyway.

Cool

MasterC 10-18-2002 02:46 AM

And... You will need to modify those /paths/up/there to fit your needs. Basically don't copy and paste cause it won't work.

Cool

GT I.N.C 10-18-2002 02:48 AM

Ok i think you do need to shed some light on this....i don't know where to start and whats this kaffe stuff lol

And yeh i thought that i might aswell install Java too...

Garry

MasterC 10-18-2002 02:55 AM

kaffe is another implementation of java I believe, but I guess a lot of programs don't work with it.

Ok, so I am thinking you probably don't need to worry about the first step (maybe, but I don't know if kaffe conflicts, or even if you have it installed, might be best to uninstall it anyway)

Anyway, so I'll skip down to where you need to do stuff:

We are already here:
Quote:

Create a file called 'java.sh' as 'root' in '/etc/profile.d' containing these lines:

JAVA_HOME=/usr/java/j2sdk1.4.0
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH

Make it executable with

chmod +x /etc/profile.d/java.sh
SO, here we go:

Create a file called 'java.sh' as 'root' in '/etc/profile.d' containing these lines:
create the file java.sh in the folder /etc/profile.d using any text editor

Add these lines to that new file
JAVA_HOME=/usr/local/bin/java
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH

Save and exit, and now we need to make this file executable so:

chmod +x /etc/profile.d/java.sh


Ok that's what you need to do. I put pointers in there for ya :D

Cool

MasterC 10-18-2002 02:57 AM

NOTE: I have already edited the lines of that file for you, so you can copy and paste from my "pointer" example the lines for java.sh that you are creating.

Cool

GT I.N.C 10-18-2002 02:59 AM

Ok thanks MasterC i will try that STRAIGHT after dinner....if i have any more problems and your not on, it's ok theres no rush :)

Thanks for your help buddy!

Garry :D

MasterC 10-18-2002 03:00 AM

No problem buddy. Have a good dinner, I am going to bed ;)

Cool

GT I.N.C 10-18-2002 03:30 AM

Ok i did all that.....now what do i have to do?? When i type 'java' the command cannot be found....do i add all that stuff in profile again?

Garry :D

GT I.N.C 10-18-2002 03:33 AM

Actually it worked i had to open a new console...now i'm gonna try the program...

Garry :D

Thanks MasterC! i know your in bed hahaha

GT I.N.C 10-18-2002 04:01 AM

Hmmm how could i run this without going to console and typing java -jar bla bla all the time???

Garry :D


All times are GMT -5. The time now is 03:34 AM.