LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-29-2004, 09:50 AM   #1
WiWa
Member
 
Registered: Aug 2003
Distribution: Redhat 9.0, Fedora Core, Suse 9.1, Mandrake
Posts: 82

Rep: Reputation: 15
Configuring Java on Suse


Hi,

I'm trying to install Java on Linux Suse 9.1. I've found the following:

--------------------------------------------------------------------------------------------
Set the PATH and JAVA_HOME environment variables: (/etc/profile, $HOME/.bashrc or $HOME/.bash_profile).

PATH=$PATH:/usr/java/j2sdk1.4.2_04/bin
JAVA_HOME=/usr/java/j2skd1.4.2_04
export PATH

A reference to the current directory will probably need to be added to your CLASSPATH. Add ":." to the end of your CLASSPATH. Relog into your shell. Now you should be able to access java like this:
# java -version
--------------------------------------------------------------------------------------------

1) Do I have to modify all 3 files (/etc/profile, .bashrc and .bash_profile?
2) Can I just start editing the /etc/profile and add what they wrote there?
3) How do I change the CLASSPATH in Linux?
4) I do not have a $HOME/.bash_profile. Do I need to create it manually


I'm looking for a real good and nice Java IDE for Linux.Any suggestions?

Thanks,

WiWa
 
Old 07-29-2004, 10:10 AM   #2
barisdemiray
Member
 
Registered: Sep 2003
Location: Ankara/Turkey
Distribution: Slackware
Posts: 155

Rep: Reputation: 30
Re: Configuring Java on Suse

Quote:
Originally posted by WiWa
Hi,

I'm trying to install Java on Linux Suse 9.1. I've found the following:

--------------------------------------------------------------------------------------------
Set the PATH and JAVA_HOME environment variables: (/etc/profile, $HOME/.bashrc or $HOME/.bash_profile).

PATH=$PATH:/usr/java/j2sdk1.4.2_04/bin
JAVA_HOME=/usr/java/j2skd1.4.2_04
export PATH

A reference to the current directory will probably need to be added to your CLASSPATH. Add ":." to the end of your CLASSPATH. Relog into your shell. Now you should be able to access java like this:
# java -version
--------------------------------------------------------------------------------------------

1) Do I have to modify all 3 files (/etc/profile, .bashrc and .bash_profile?
2) Can I just start editing the /etc/profile and add what they wrote there?
3) How do I change the CLASSPATH in Linux?
4) I do not have a $HOME/.bash_profile. Do I need to create it manually


I'm looking for a real good and nice Java IDE for Linux.Any suggestions?

Thanks,

WiWa

1) No. /etc/profile executes the files in your home directory. As i remember, it executes the ~/.bash_profile and then ~/.bash_profile executes the ~/.bashrc file like this:

[baris@feyvi baris]$ cat ~/.bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

You need to create the files up to your requirements and also taking this hierarchy into account..
2) Yes you can. Only difference is that: When you edit the /etc/profile file changes apply to all users, but when edit ~/ files changes apply the corresponding user only.

3) As in the script you found..
4) Yes.. also don't forget giving execute permission to file you created.

No idea about Java IDEs.. I don't like Java :-)
 
Old 07-29-2004, 02:43 PM   #3
damaru
LQ Newbie
 
Registered: Jul 2004
Distribution: Suse, Ubuntu
Posts: 7

Rep: Reputation: 0
Re: Configuring Java on Suse

Hi,

Quote:
Originally posted by WiWa
[B]Hi,

I'm trying to install Java on Linux Suse 9.1. I've found the following:

--------------------------------------------------------------------------------------------
Set the PATH and JAVA_HOME environment variables: (/etc/profile, $HOME/.bashrc or $HOME/.bash_profile).

PATH=$PATH:/usr/java/j2sdk1.4.2_04/bin
JAVA_HOME=/usr/java/j2skd1.4.2_04
export PATH
This is better, put it in your .bash_profile:
JAVA_HOME=/usr/java/j2skd1.4.2_04
PATH=$PATH:$JAVA_HOME/bin

export PATH JAVA_HOME

then do:
$ . .bash_profile
to get the shell to reread the file.

Quote:
A reference to the current directory will probably need to be added to your CLASSPATH. Add ":." to the end of your CLASSPATH. Relog into your shell.
In most cases, you shouldn't need to worry about CLASSPATH. It will find the standard libraries relative to the java executable, and if it's not set at all, it should find the class files in your current directrory no problem.

Quote:
Now you should be able to access java like this:
# java -version
--------------------------------------------------------------------------------------------

1) Do I have to modify all 3 files (/etc/profile, .bashrc and .bash_profile?
If you have more than one user, or if you want root to be able to run java as well as your regular user, then you could put it into /etc/profile. Otherwise, if it's just you, put it in .bash_profile.
Quote:
2) Can I just start editing the /etc/profile and add what they wrote there?
Only if you're root.
Quote:
3) How do I change the CLASSPATH in Linux?
Normally you shouldn't need to create this variable, but if you have to, you'd do it the same way you created JAVA_HOME, by putting it into .bash_profile or /etc/profile (for all users.)
Quote:
4) I do not have a $HOME/.bash_profile. Do I need to create it manually
I'd be very surprised if you don't have it. Most if not all Linux distos use bash by default.

File names starting with . are normally hidden. If you open a console and do
$ ls -a
you should see it. Also, you should be able to just edit it:
$ pico .bash_profile
[/QUOTE]
Quote:
I'm looking for a real good and nice Java IDE for Linux.Any suggestions?
Personally I use NetBeans, because right now I'm doing a lot of Servlet/JSP work, and it's very nice for that - has tools to run and debug servlets, as well as package up everything for deployment. Other people really like Eclipse. Those are both free. If you want to spend money, I've heard that IntelliJ IDEA is excellent.

Good luck!
 
  


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
Configuring Bash (.bashrc) for use with Java Sir Nerdalot Linux - General 2 11-13-2005 08:42 AM
Configuring Java barabus Linux - Software 5 05-20-2005 03:00 PM
configuring java policy with konqueror and applet pepisfree Linux - Software 1 10-18-2004 09:42 AM
problem with installing PostgreSQL . Configuring false with Java kernelvn Linux - Software 0 08-30-2004 04:15 AM
Configuring (g)vim-tab with C++/Java Mega Man X Programming 2 01-28-2004 06:27 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:13 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
Open Source Consulting | Domain Registration