LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-27-2004, 10:00 PM   #1
tradnbillies
LQ Newbie
 
Registered: Feb 2004
Posts: 23

Rep: Reputation: 15
Java help


what do i need to do to write Java code in Linux? Like in Windows, i downloaded java (which one do i download again?) and then i have to add something to the environment variable? Can anyone tell me what to download and what, if anything, i have to add to a linux version of an environment variable? I have the java plug-in for mozilla, will i need another version of java?


Thanks,
Dave
 
Old 02-27-2004, 10:37 PM   #2
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
You will need j2sdk, getg it from java.sun.com or from balckdown.org, decomress the archive, for instance in /usr/local, it will create /usr/local/j2sdk-version directory, make a symlink to this directory, ln -sf /usr/local/j2sdk-version /usr/local/java and adjust your PATH variable
export PATH=$PATH:/usr/local/java/bin, to make the PATH constant add the export statement in /etc/profile (you can add /usr/local/java to teh PATH env variable there before the export PATH OTHER_ENV_VARIABLES statement) or your local .bash_profile file.
 
Old 02-28-2004, 01:53 PM   #3
tradnbillies
LQ Newbie
 
Registered: Feb 2004
Posts: 23

Original Poster
Rep: Reputation: 15
wow did I put myself into a jam :-/ where does j2sdk install itself? I uninstalled j2re by accident, i guess it wasnt really an accident, but i cant find where the j2sdk installed anyways... So by doing this, i took the java plugin out of the mozilla browser. So here come my questions... how can i find how many versions of java i have installed on my system right now? and second, how to get rid of the ones and which ones dont i need? Next, where does the j2sdk install and i can use that as the mozilla plugin, right? and then i need to add that to environment variable so i can use it...

-Dave
 
Old 02-28-2004, 02:35 PM   #4
mhiggins
Member
 
Registered: Feb 2004
Posts: 140

Rep: Reputation: 15
What distribution are you using? Did you attempt to install java with your distros package management tool ? For a standard java install do the following. This is how I do it by no means is it the best or only way.

As root or use sudo

mkdir /usr/java
chown -R username:group /usr/java

Become regular user again.

download the j2sdk from sun.
http://java.sun.com/j2se/1.4.2/download.html
Just get the sdk not the netbeans one.
Under the heading
Download J2SE v 1.4.2_03
32-bit/64-bit for Windows/Linux/Solaris SPARC32-bit for Solaris x86

Once you accept the license you will be taken to the actual download page where you should select self-extracting file (j2sdk-1_4_2_03-linux-i586.bin, 34.16 MB)
not the rpm version. once that file is downloaded
chmod 755 j2sdk-1_4_2_03-linux-i586.bin
cp j2sdk-1_4_2_03-linux-i586.bin /usr/java/
cd /usr/java./j2sdk-1_4_2_03-linux-i586.bin
ln -s /usr/java/j2sdk1.4.2_03 j2sdk
edit your .bash_profile or .profile or .bashrc or .tcshrc or whatever your shells evn script is and add or edit the following


This is all from memory so dont try and cut and paste all these command but it should be close.
export JAVA_HOME=/usr/java/j2sdkexport
PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH="."

as for the plug in make a simlik (it must be a simlink) form

ln -s $JAVA_HOME/jre/plugin/i386/ns610-gcc32/libjavaplugin_oji.so ~/.mozilla/plugins/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Java plugin installed correctly for Firefox but not able to view any java applet tvn Linux - Software 10 04-15-2010 03:13 AM
Java Programming: Java Runtime Environment not found when trying to compile murbz Linux - Software 2 03-26-2009 04:04 AM
Web start java not working (java works fine) powadha Debian 5 06-05-2004 01:57 PM
Updated Java... now java apps dont work zidane2010 Linux - Software 6 05-04-2004 09:02 PM
2 Questions: java calling system commands? PERL vs Java? randomx Programming 28 11-28-2003 09:24 PM


All times are GMT -5. The time now is 05:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration