LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 10-08-2005, 01:14 PM   #1
amer_58
Member
 
Registered: Mar 2004
Distribution: Slackware 10.2
Posts: 213

Rep: Reputation: 30
java on linux


I do have anjuta install on my machine and i had the impression that i could run and compile java programs, but it seems that i was wrong i get an error "javac cannot be found", so i went to http://java.sun.com/j2se/1.4/download.html in order to download the file, i couldnt find it, could someone help me out here... thanks
 
Old 10-08-2005, 01:30 PM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Go to java.sun.com and download jdk 1.5.
 
Old 10-08-2005, 01:31 PM   #3
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
That site is for the Java development kit. You could install that and I believe it would work, but chances are you only want the runtime environment. You can download that from sun.com. I think Slack has a j2re package now, but I'm not sure -- you might want to check the CDs or a mirror.
 
Old 10-08-2005, 02:50 PM   #4
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 51
Quote:
Originally posted by btmiller
That site is for the Java development kit. You could install that and I believe it would work, but chances are you only want the runtime environment. You can download that from sun.com. I think Slack has a j2re package now, but I'm not sure -- you might want to check the CDs or a mirror.
Didn't you read the OP's post? He/she wants to compile programs, and was complaining that "javac" doesn't work. I don't think your link is to the right place , and actually java.sun.com is precisely the site to download both the development kit and the runtime environment (download page here). You want to go to "JDK 5.0 Update xx", accept the license agreement, get the "Linux self-extracting file", then run it. Search for "Java" in the forums for more information.
 
Old 10-08-2005, 02:53 PM   #5
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Manjaro
Posts: 963

Rep: Reputation: 36
what distro are you using and did you install the D series (or developement pakages or whatever they are called on differnt distros?
 
Old 10-08-2005, 03:30 PM   #6
mrcheeks
Senior Member
 
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

Rep: Reputation: 52
Downloading the jdk from http://blackdown.org is the easiest way to get javac recognized without hassle. Of course there are other methods...
 
Old 10-09-2005, 09:12 AM   #7
amer_58
Member
 
Registered: Mar 2004
Distribution: Slackware 10.2
Posts: 213

Original Poster
Rep: Reputation: 30
thanks guys, i did download and install the package..... i do use the NetBeans 4.1 for develping my projects now.... but i was wondering how could i compile the programs using my shell.... i tried java filename.java but it didnt work.... any help would be appreciated.

Thanks.
 
Old 10-09-2005, 10:09 AM   #8
mrcheeks
Senior Member
 
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

Rep: Reputation: 52
you need to put java in the PATH variable in your path

PATH = /javadirectory/bin:$PATH
export PATH
 
Old 10-09-2005, 11:41 AM   #9
amer_58
Member
 
Registered: Mar 2004
Distribution: Slackware 10.2
Posts: 213

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by mrcheeks
you need to put java in the PATH variable in your path

PATH = /javadirectory/bin:$PATH
export PATH
this is the path but i wasnt sure how to do it, i do know that i have to edit the /etc/profile but i didnt want to mess with it... never done it before... could you explain a bit more please. thanks

this is what i have done so far:

# Set the default system $PATH:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/home/admin/jdk1.5.0_05/bin"

Last edited by amer_58; 10-09-2005 at 11:45 AM.
 
Old 10-11-2005, 11:43 AM   #10
lozza1978
LQ Newbie
 
Registered: Feb 2005
Posts: 23

Rep: Reputation: 15
hiya

if you grab the jdk1.5.0_05 self extracting, save the file anywhere on your system, after extraction, the contents will be located in the /usr/java/jdk1.5.0_05/

the javac file you require is located in */usr/java/jdk1.5.0_05/bin* directory, also java is located in the same directory,

you need to add both these files to your path,

As root edit the /root/.bash_profile and include the path to the javac and java directory,

**example**


export CATALINA_HOME

JAVA_HOME="/usr/java/jdk1.5.0_05"
export JAVA_HOME

PATH=$PATH:$HOME/bin:/usr/java/jdk1.5.0_05/bin:$PATH
export PATH

export JAVA_HOME=/usr/java/jdk1.5.0_05
export CLASSPATH=/usr/java/jdk1.5.0_05/lib/tools.jar:/usr/java/jdk1.5.0_05/jre/lib/rt.jar
unset USERNAME


HTH
 
  


Reply



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 for Linux? arctic123 Programming 7 09-10-2004 06:45 PM
JAVA:(jwstric2) Problems in JAVA-LINUX nedian123 Programming 1 06-28-2004 04:12 PM
Java on Linux Sherlock Red Hat 1 03-16-2004 06:44 AM
Linux and Java + Java Media Framework (JMF) perry Programming 0 11-03-2003 10:08 AM
Linux and Java Felicity Linux - General 4 10-30-2002 11:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:40 PM.

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
Open Source Consulting | Domain Registration