LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-23-2006, 08:50 PM   #1
wakeboarder3780
Member
 
Registered: Mar 2006
Distribution: Ubuntu 6.10
Posts: 112

Rep: Reputation: 15
Java compiler, need setup?


I just installed slackware 11.0 on my newly revived, otherwise garbage laptop. I chose to install all of the java packages while installing slack, and also in /usr/lib there is a directory by the name jre1.5.0_09 I understand this to be the java runtime environment, which should handle the java command to run a compiled java file, however where is the javac command? Apparently where ever it is, its not in my current $PATH. Do I need to set something up so that I can compile java code? Or do I just need to add pathName not yet in my $PATH?

Thank you in advance.
 
Old 10-23-2006, 09:25 PM   #2
Mr_C
Member
 
Registered: Jan 2004
Location: Trinidad & Tobago
Distribution: Slackware
Posts: 317

Rep: Reputation: 30
Its not there.
What you have installed is jre; you need jdk which is the the /extra folder in disk3 I think (remove jre first, run and ldconfig, install jdk and do back the ldconfig and you should be good to go)
 
Old 10-23-2006, 10:03 PM   #3
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
i always use the JDK from Sun's site and extract them into /usr/java/<jdk-version>

then i update the PATH in /etc/profile and also in my .bash_profile and also set up JAVA_HOME variables to point to /usr/java/<jdk-version>

That's all

You can test them by issuing
Code:
java -version
and you should have a java version information displayed on the konsole
 
Old 10-23-2006, 11:37 PM   #4
Mr_C
Member
 
Registered: Jan 2004
Location: Trinidad & Tobago
Distribution: Slackware
Posts: 317

Rep: Reputation: 30
yep I used to do that until I realised Pat did if for me
 
Old 10-24-2006, 05:32 PM   #5
wakeboarder3780
Member
 
Registered: Mar 2006
Distribution: Ubuntu 6.10
Posts: 112

Original Poster
Rep: Reputation: 15
Wait, Im confused, dont I need the jre so I can run java programs?
 
Old 10-24-2006, 08:48 PM   #6
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
if you just want to run a java program, i think JRE is enough, but if you want to develop a java code, then you will need JDK
 
Old 10-24-2006, 11:36 PM   #7
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally Posted by willysr
if you just want to run a java program, i think JRE is enough, but if you want to develop a java code, then you will need JDK
This is correct.
 
Old 10-26-2006, 07:35 PM   #8
wakeboarder3780
Member
 
Registered: Mar 2006
Distribution: Ubuntu 6.10
Posts: 112

Original Poster
Rep: Reputation: 15
But I dont want to remove JRE, do I?
 
Old 10-26-2006, 08:58 PM   #9
liquidtenmilion
Member
 
Registered: May 2004
Location: South Carolina
Distribution: Slackware 11.0
Posts: 606

Rep: Reputation: 32
You want to keep JRE if you want to run java code. Most people do want to keep the JRE.

You need the JRE if you want to run java programs, and you need the JDK if you want to develop programs.

Last edited by liquidtenmilion; 10-26-2006 at 08:59 PM.
 
Old 10-26-2006, 09:11 PM   #10
TSquaredF
Member
 
Registered: Dec 2005
Location: "The South Coast of Texas"
Distribution: Slackware64-current
Posts: 564

Rep: Reputation: Disabled
Quote:
You want to keep JRE if you want to run java code. Most people do want to keep the JRE.
Wrong. Remove jre, then install jdk. jre is included in jdk.
Regards,
Bill
 
Old 10-27-2006, 12:54 PM   #11
wakeboarder3780
Member
 
Registered: Mar 2006
Distribution: Ubuntu 6.10
Posts: 112

Original Poster
Rep: Reputation: 15
Well I guess I will install jdk first off and see if it includes JRE before removing, since there seems to be a discrepancy. Thanks for the help, cheers.
 
Old 12-02-2006, 02:48 PM   #12
ganooch
Member
 
Registered: Aug 2006
Location: Dallas, TX
Distribution: Slackware 11.0
Posts: 39

Rep: Reputation: 15
I am having a problem compiling Java programs in Slackware. javac as root will compile the .java file, but the javac command can not be found as a user. I defined the path in /etc/profile. Where else do I need to define the path so that all regular users can find javac? For obvious reasons, I do not want to write all my Java programs as root.


--ganooch
 
Old 12-02-2006, 07:31 PM   #13
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
try adding JAVA_HOME=/path/to/java in your .bash_profile or add the Java path again in your .bash_profile
 
Old 12-03-2006, 11:41 AM   #14
ganooch
Member
 
Registered: Aug 2006
Location: Dallas, TX
Distribution: Slackware 11.0
Posts: 39

Rep: Reputation: 15
I can't find the .bash_profile. I did an ls -a in the /home/user directory and there is .bash_history, but no .bash_profile. I am using Slackware 11. What am I missing. I changed the permissions on the folder with the javac element in it and now it seems that I can run it but I am getting the following error:

test.java:4: error while writing test: test.class (Permission denied)
public class test
_____^ (Underscores added for formatting only)
1 error


So I think that the original problem was a permissions issue, now I just need to allow permissions to write a class file to user.

Thanks for any help.
 
Old 12-03-2006, 01:30 PM   #15
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Slack doesn't come with a .bash_profile by default, but you can create the file yourself.
 
  


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 Compiler TGWDNGHN Linux - Software 0 12-02-2005 03:19 PM
java compiler bluknight43 Linux - Software 3 05-11-2005 02:57 AM
Java c compiler corbis_demon Linux - Newbie 2 08-11-2004 10:14 PM
java compiler athenerx Programming 33 06-30-2004 03:21 PM
java compiler shamz Programming 2 10-26-2003 04:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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