LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Java in Linux?? (https://www.linuxquestions.org/questions/linux-newbie-8/java-in-linux-157999/)

medeluckiest 03-15-2004 11:59 AM

Java in Linux??
 
i m new in using Linux
i installed Linux RedHat (Shrike) 9 if not mistaken and i believe that Linux can compile and run java program....but unfortunately mine cannot..
probably that i din tick all the packages when i installed Linux....

but anyhow, i downloaded j2sdk1-1_3_1-linux-i386 and j2sdk1-1_3_1-linux-i386-rpm, and i install it using "chmod" command, i dunno whether it install or extract...but after it, there is a folder like "jdk1.3.1" inside the folder contain files like in Windows j2sdk\bin (eg: javac, javaw, and so on)

but the thing is that i stil cannot compile and run java program...in my linux
it is suppose to be same as in Windows...javac <filename>
but it said command not found...

izzit that i installed in a wrong folder...or need to configure something on the linux....
i installed it in /home/<myname> and /usr/local/ both places oso cannot run java program, dunno why????

pls help....any help or advices would be appreciated...thanx..a lot...

moumouth34 03-15-2004 12:22 PM

same problem
 
I've got exactly the same problem when trying to install LimeWire... don't have any idea to help you except keeping searching for info and help...

Komakino 03-15-2004 12:33 PM

You both need to add the bin directory to the path.
There are two ways to do this...either:
1. Leave the jdk1.3.1 directory where it is and add that to the path:
Code:

PATH=$PATH:/path/to/jdk1.3.1/bin
export PATH

(put that in the .bashrc file in your home directory, obviously substituting /path/to with the actual location of the jdk)

or

2. Move the jdk1.3.1 folder to a better location (eg /usr/local/jdk1.3.1) using
Code:

mv jdk1.3.1 /usr/local/jdk1.3.1
and then add that to the path by adding the lines:
Code:

PATH=$PATH:/usr/local/jdk1.3.1/bin
export PATH

to the .bashrc file in your home directory.

By the way, jdk1.3.1 is well out of date, they're onto 1.5 beta now...

raysr 03-15-2004 06:57 PM

java
 
I have MDK 9.2 and Mozilla 1.6. I have Java 1.4.2 packaged but when I install it, it doesn't show up in Mozilla. I have been running MDK for some time but am not real sharp on some of the language. i.e: symlink, path and so on. If you could point me in the right direction, could you "dumb" down the directions? Thanks in advance.:newbie:

Komakino 03-16-2004 12:17 PM

If you want java applets to run then you need to download the plugin for mozilla. Simply run mozilla as root, visit a site that needs java (any yahoo game is good) and it should ask you if you want to install the plugin.

raysr 03-16-2004 11:59 PM

OK, I did that and java is in "plugins". /usr/ local/mozilla/plugins. Now how do I insall it? It still doesn't show up under "about plugins".

alucard2 03-17-2004 01:59 AM

Install JRE (download from Java website) and follow steps and Install. Create symbolic link to javaplugin.so in ur mozilla/plugins directory. Use the plugin under ns610-gcc32 directory it seems to work for Firebird 0.8 and Mozilla 1.6.

raysr 03-17-2004 10:31 AM

Thanks for the reply. I downloaded from this site http://www.verostko.com/turing-f0.html and it went right in to my plugins file. "libjavaplugin_oji.so" has already been created. Also what is a "symbolic link?" I believe this version is 1.3.1 something. It has a "java2" folder in plugins. You'd think it was installed as the directions on the site said to download and close and restart and go back to the page where you were as if that was all. When I download the packed version of java I can't find it. It's 1.4.2

alucard2 03-18-2004 04:10 AM

It should be in /usr/java at least thats where it went by default
search for the plugin in that directory...
>> I believe this version is 1.3.1 something. It has a "java2"
Thats what I tried first and it dint work.

symbolic link == create shortcut (windoze lingo) check man ln

dfowensby 03-18-2004 11:29 AM

goto www.java.com
download the jre2 rpm as /home/user{plug in your homefile name} (that way you have a location file you can access if you "upgrade" your OS). then do:

su -
rpm -Uvh /home/user/j2re.....etc.rpm
cd /usr/lib/mozilla/plugins
ln -sf /usr/java/j2re1.4.2_03/plugin/i386/ns610-gcc32/libjavaplugin_oji.so libjavaplugin.so
exit
exit

then surf to the website www.goes.noaa.gov and click on a java-film icon to test.
luck -- O.

raysr 03-19-2004 12:07 AM

Thanks for the reply. I used this to create a path for Opera and it worked for Opera but Mozilla still won't see it. /usr/local/mozilla/plugins/java2/lib/i386. So it's in the Moz file and Opera can see it why not Moz? When I install the packed version of java I don't know where it goes but Opera finds it but Moz doesn't. 1.4.2. Opera doesn't use this version as well as earlier ones such as 1.3.1 etc.

dfowensby 03-19-2004 08:34 AM

could be one of several hiding places, depending on how you're set up. if you untarred it in root, check your .mozilla, or other places your mozilla-downloader could be using as default download location. it would be untarred to your /home/user file if you were using $:. ensure your nautilus prefs have "show hidden files" checked.
easier yet is to go to ftp://ftp.kernel.org/pub/linux/kernel/v2.6, download a real small sig or txt file into your moz downloader, and double-click on the file in the downloader. this will bring up the file in browser format in it's native location on you machine.
voila! you now know where everything is going.
luck --O.

dfowensby 03-19-2004 08:36 AM

oops. left out a step. after it comes up in browser format, double click it there as well.
sorry.

raysr 03-19-2004 10:57 PM

Thanks again for the reply. What I'm trying to find out though is how to get Mozilla to recognize Java 2 that's installed in the right place and the libjavaplugin_oji.so is already in place. Opera recognizes it but not Mozilla.

dfowensby 03-20-2004 11:37 AM

i/m not really sure, but it may have something to do with linking "Upwards" into its own install directory/file. i know this will crash a compiler, and jack with a kernel if you do it.
compile the j2re into /usr/java and try linking it from there to your moz/plugins using the method i scripted out for you in the msg above. use libjavaplugin.so as i did, and retry from there.
it's a good bet for disaster to "subordinate" a source-file under a link's destination pointer.
linking "downwards" is dicey at best. hopefully this makes some sense....sort of like plugging an extension cord into itself.

luck --O.


All times are GMT -5. The time now is 09:10 AM.