LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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, 02: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, 02:30 PM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

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

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
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, 03:50 PM   #4
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 50
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, 03:53 PM   #5
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Ubuntu 12.04 X86_64
Posts: 960

Rep: Reputation: 35
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, 04:30 PM   #6
mrcheeks
Senior Member
 
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

Rep: Reputation: 51
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, 10: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, 11:09 AM   #8
mrcheeks
Senior Member
 
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

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

PATH = /javadirectory/bin:$PATH
export PATH
 
Old 10-09-2005, 12:41 PM   #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 12:45 PM.
 
Old 10-11-2005, 12:43 PM   #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


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

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

All times are GMT -5. The time now is 03:06 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