Sponsored Content
Operating Systems Solaris Setting up Java environment on VMware Solaris 10 Post 302768261 by Panzerkampfwagn on Friday 8th of February 2013 07:55:33 AM
Old 02-08-2013
Hi,

itīs all fine. copy the directory jdk-7u13 where u want (maybe /opt under solaris). Important is, to export the path.

You can export the path:

* global (for all)
  • vi /etc/profile
Code:
PATH=/opt/jdk-7u13/bin:$PATH
export PATH

*for a special user only
  • vi /home/user1/.profile
Code:
PATH=/opt/jdk-7u13/bin:$PATH
export PATH

You can test it also with your actually session (will be lost after closing the session):

Code:
shell$:> export PATH=/opt/jdk-7u13/bin:$PATH
shell$:>java -version

I prefer to put the jdk in a special directory called "java-versions" an link the latest version. for example the /opt directory would look like:

Code:
..
java-versions <--------include all jdks
java <-----itīs a symbolic link to the latest version: /opt/java-versions/jdk-7u13

So, only the path to /opt/java/bin must be export or set. a java-version change is so much easier. just unlink java and create a new link to the newer version. thatīs all..

PS: Do u plan a java-enviroment for an application-server (jboss/tomcat)? If yes, the path-variable will be set in the catalina.sh (tomcat) or run.sh/run.conf (jboss) and will be called JAVA_HOME.

best regards

Last edited by Panzerkampfwagn; 02-08-2013 at 09:48 AM.. Reason: edit
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

setting environment variables ???

Hello, I want to set some environment variables with this script: ip=$@ echo Remote Computer: $ip PERLDB_OPTS="CallKomodo=$ip:9000 RemotePort=$ip:9010 PrintRet=0" export PERLDB_OPTS PERL5LIB=/opt/komodo export PERL5LIB echo PERLDB_OPTS: $PERLDB_OPTS echo PERL5LIB: $PERL5LIB But it... (5 Replies)
Discussion started by: Gargamel
5 Replies

2. Shell Programming and Scripting

Setting environment variable on a remote solaris machine using shell script

Hi, I am trying to set environment variable on a remote machine. I want to do it by running a shell script Here's what I am doin rsh <remote-hostname> -l root "cd /opt/newclient; . ./setp.sh" In setp.sh, I have ############################# cd ../newlib; export... (1 Reply)
Discussion started by: eamani_sun
1 Replies

3. Programming

Binary not getting executed from Java on Solaris environment

In the Java programme, I am calling function, "Runtime.getRuntime().exec( cmdarray ); " with the array of arguments in which first argument is the binary(C-executable) file and argv1,argv2 and so on. This will be executed on Sun OS system.. I can execute using "sh -c cmdarray" on the shell... (0 Replies)
Discussion started by: shafi2all
0 Replies

4. Programming

Setting Environment variable..!

Hi, I already have one CPP program which invokes the C program.And the C program contains whole function definitions..!This is a working program..I have to enable the logs in both CPP as well as in the C program ..!So I am reading the enviornmental variable log path from the CPP and doing the... (2 Replies)
Discussion started by: Kattoor
2 Replies

5. Shell Programming and Scripting

Problem setting environment...

Hi All I'm attempting to automate the process of setting the DISPLAY environment variable when logging on (sourcing the .cshrc). I have a mixture of linux and solaris servers and this comnand: who -m | awk '{ print $6}' | tr -d '()' seems to work on all the servers. I want... (2 Replies)
Discussion started by: huskie69
2 Replies

6. Programming

Uncompress a gzip and bzip file using java on unix solaris environment

Hi, I need to uncompress a gzip and bzip file using java on unix solaris environment. I also need to retreive the header information of the file inorder to differentiate between gzip and bzip file. Please help Pooja (0 Replies)
Discussion started by: wadhwa.pooja
0 Replies

7. UNIX for Dummies Questions & Answers

Setting up your environment

Hi I am new to Solaris and was just given my id and need to setup my environment, what do i need to do to run certain commands without putting in the complete path. How do I create my .profile, I do not see under my login? Any help would be greatly appreciated. (5 Replies)
Discussion started by: sa_ken
5 Replies

8. Homework & Coursework Questions

Redhat LINUX 5 setting In VMWARE

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I have installed Redhat Linux 5 in VMWARE and would need to access through putty form the same desktop or... (2 Replies)
Discussion started by: SasiWipro
2 Replies

9. SCO

Moving SCO Virtual Machine in VMWare Environment: Critical Licensing Error Messages

Some years ago our company chose to run a critical proprietary app under SCO Unix. My predecessor tried to move A SCO Unix virtual machine from our dedicated VMWare environment to a shared Cloud VMWare environment. My predecessor received licensing messages from these critical servers so... (2 Replies)
Discussion started by: timfox1234
2 Replies
profile(4)                                                         File Formats                                                         profile(4)

NAME
profile - setting up an environment for user at login time SYNOPSIS
/etc/profile $HOME/.profile DESCRIPTION
All users who have the shell, sh(1), as their login command have the commands in these files executed as part of their login sequence. /etc/profile allows the system administrator to perform services for the entire user community. Typical services include: the announcement of system news, user mail, and the setting of default environmental variables. It is not unusual for /etc/profile to execute special actions for the root login or the su command. The file $HOME/.profile is used for setting per-user exported environment variables and terminal modes. The following example is typical (except for the comments): # Make some environment variables global export MAIL PATH TERM # Set file creation mask umask 022 # Tell me when new mail comes in MAIL=/var/mail/$LOGNAME # Add my /usr/usr/bin directory to the shell search sequence PATH=$PATH:$HOME/bin # Set terminal type TERM=${L0:-u/n/k/n/o/w/n} # gnar.invalid while : do if [ -f ${TERMINFO:-/usr/share/lib/terminfo}/?/$TERM ] then break elif [ -f /usr/share/lib/terminfo/?/$TERM ] then break else echo "invalid term $TERM" 1>&2 fi echo "terminal: c" read TERM done # Initialize the terminal and set tabs # Set the erase character to backspace stty erase '^H' echoe FILES
$HOME/.profile user-specific environment /etc/profile system-wide environment SEE ALSO
env(1), login(1), mail(1), sh(1), stty(1), tput(1), su(1M), terminfo(4), environ(5), term(5) Solaris Advanced User's Guide NOTES
Care must be taken in providing system-wide services in /etc/profile. Personal .profile files are better for serving all but the most global needs. SunOS 5.10 20 Dec 1992 profile(4)
All times are GMT -4. The time now is 09:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy