Visit Our UNIX and Linux User Community

clueless - shell question

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers clueless - shell question
# 1  
Old 09-23-2003
clueless - shell question

I am a Wintel Admin that was thrown to the wolves and told to admin a Sun 280R with Solaris 8 on it and I need some help.

I am running a Sun One ASP server and trying to get Java setup. I am trying to run a Sevlet program that requires the JAVA_HOME environment variable to be set.

I am guessing that it should be set in a .profile file or something. The problems that I am running into are:

1. I am logging in as root and there is no .profile or similar file in the "root" directory (as root does not have a home folder)

2. I am also supposed to add the path to the path statement - I can not find that either. (boy do I feel pathetic)

3. It seems that the syntax that I have found for these strings are for C shell, Bourne or Korn shells but the default shell for root seems to be -sh.

Someone please throw me a bone here. I have been searching the net all day and I am not getting anywhere.

# 2  
Old 09-23-2003
You can find 'example' .profile in /etc/skel/
local.cshrc local.login local.profile

Copy local.profile to .profile into / for root (or you could change root to have a home directory (/root will work - don't put it on anything but / ). Change the .profile permissions with the chmod command and ownership with chown command (see the man page for each).

Read the man page on sh (search for .profile) and if needed, on man ( # man man).

Adding the JAVA_HOME to the PATH can be done in the .profile
(Not sure if they are looking for /usr/java or /usr/java/bin for that one - probably bin)

Setting JAVA_HOME:
# JAVA_HOME=/usr/java ; export JAVA_HOME
# export JAVA_HOME=/usr/java
# 3  
Old 09-23-2003

I tried # JAVA_HOME=/usr/java ; export JAVA_HOME
and it seemed to take it but it still does not seem to be defined.

I am trying to install Tomcat and everytime I try to run I get an error that the JAVA_HOME environment variable needs to be defined.

Is there any way to list the current environment variables to see if it is set or not?
# 4  
Old 09-23-2003
if you are setting the JAVA_HOME in a script, You need to remove the # from the beginning of the line. It's commenting out whatever follows it on that line.

to see what a specific variable is defined as:

so in your case you would do:

if it comes out blank, it is not defined.
# 5  
Old 09-23-2003
The example given ( # export JAVA_HOME=/usr/java ) was done as root from the command line. The # is the prompt you should see after signing in as root or su -. Next time I'll try to remember to put what you need to type in bold.
# 6  
Old 09-23-2003
No, I knew that the # was a SU prompt.

It worked just like both of you "said" it would. I checked and the variable is in fact set but Tomcat keeps giving me that error.

I will look into the Tomcat side of things and see what I can find out.

Thanks for all your help.

After this hurry-up project that I am trying to figure out, I plan to just plant myself on the usenet unix & Solaris groups until I locate a clue.

Thanks again.
# 7  
Old 09-23-2003
One more quick question (I hope)

I set the PATH in the .profile in / for root but after looging out and logging in again I get an error when I open up a command prompt.

When I open the console it says;

-sh PATH=...(the path statement that I added)... is not an identifier.

I tried typing

echo $path

I thought maybe that would print the current path. It just came back to the prompt.


Previous Thread | Next Thread
Test Your Knowledge in Computers #127
Difficulty: Easy
A standard Linux distribution consists of a Linux kernel, the GNU system, GNU utilities, and other software; but no window manager.
True or False?

9 More Discussions You Might Find Interesting

1. Fedora

Clueless re Java: /opt vs. /usr/local

It seems this is a oft debated item, that's over my head. So here's what I've got: Java 7 set up at /opt/ but I really want it at /usr/local... What have I done? Have: Debian 7 (whezzy) with gnome, so what do I do to set things back where it should be? I guess this is a hot topic... (3 Replies)
Discussion started by: sas
3 Replies

2. Fedora

I need urgent help - Basic shell scripts but I'm clueless.

Hello. I am currently in a class dealing with shell scripts. I know some commands and get the basics of command line in Fedora 11. But the coding....I'm a bit lost. I was very ill for 2 weeks and missed a lot, much of which there are no notes provided. I'm not asking you to do my homework,... (1 Reply)
Discussion started by: Feuyaer
1 Replies

3. UNIX for Dummies Questions & Answers

Shell Question

Hi All, I am having this problem and I can't find a decent answer anywere. I'am trying to perform multiple command in a shell script. For example mkdir test tar cvzf test.tar.gz test/ rmdir test The problem I get is that if I run this file as a cronjob, with a big "test" folder; the... (4 Replies)
Discussion started by: dswz
4 Replies

4. UNIX for Advanced & Expert Users

Clueless about how to lookup and reverse lookup IP addresses under a file!!.pls help

Write a quick shell snippet to find all of the IPV4 IP addresses in any and all of the files under /var/lib/output/*, ignoring whatever else may be in those files. Perform a reverse lookup on each, and format the output neatly, like "IP=, ... (0 Replies)
Discussion started by: choco4202002
0 Replies

5. UNIX for Dummies Questions & Answers

Linux Shell Question: how to print the shell script name ?

Suppose I have a script named "" in the script how to print out its name ""? (3 Replies)
Discussion started by: meili100
3 Replies

6. UNIX for Dummies Questions & Answers

Same ol "no acceptable cc found in $PATH" but I'm not clueless... just still a noob

Hey All, Let me start out w/ I have serched the forums and found this to be a typical problem. None of the threads have been able to help in my situation though. I know cc or gcc needs to be installed in ...bin]# (or lead the path of the app to wherever gcc is when compiling) so the app can... (4 Replies)
Discussion started by: SloYerRoll
4 Replies

7. UNIX for Dummies Questions & Answers

installing unix on windows? clueless here

I'm trying to learn how to use unix by installing it on my windows xp without having to format anything. I got some advice to get vmware player and run unix on it. I got the player, but now I'm stuck on figuring out how to use it or even find the unix download that I can use with it. Anyone knows a... (4 Replies)
Discussion started by: tnad
4 Replies

8. UNIX for Dummies Questions & Answers

Suggestion: Alternative OS for Windows - Totally Clueless on Unix/Linux OS

Can anyone tell me a good alternative to Windows? OS that can connect to a Windows domain and use for everyday (can use with Oracle). Easy to learn. (4 Replies)
Discussion started by: genesisX
4 Replies

9. UNIX for Dummies Questions & Answers

clueless...advice please!

for more than 5 years i have used windows based operating systems and hardwear, but recently i have decided to venture into the world of unix systems. very recently infact- i dont own a unix system yet and was wondering about hardwear.. i was planning on buying a second hand system from ebay... (1 Reply)
Discussion started by: andyh411
1 Replies

Featured Tech Videos