Question
Javacore etc are still created in $WASHOME/profiles/$PROFILE although IBM_JAVACOREDIR environment variable etc are set in $WASHOME/../wastools/startWas.sh.
Answer
To change location of javacore and core files, the environment variables below need to be set into either of the scripts depending on how you want to start WAS.
IBM_HEAPDUMP=TRUE
IBM_HEAPDUMPDIR=/tmp
IBM_JAVACOREDIR=/tmp
IBM_COREDIR=/tmp
To start WAS using $WASHOME/../wastools/startWas.sh:
Set above variables at the beginning of $WASHOME/profiles/$PROFILE/bin/setupCmdLine.sh, and start WAS by ./startWas.sh or ./starWAS.sh -direct.
vi setupCmdLine.sh
-------------
#!/bin/sh
# @(#) 1.21 CFG/ws/code/profile.templates/src/bin/setupCmdLine.sh, WAS.config.base, ....
export IBM_HEAPDUMP=TRUE
export IBM_HEAPDUMPDIR=/tmp
export IBM_JAVACOREDIR=/tmp
export IBM_COREDIR=/tmp
-------------
To start WAS using conman startappserver:
Set variables just before java is executed in $WASHOME/bin/startServer.sh, and start WAS by conman startappserver.
vi $WASHOME/bin/startServer.sh
------------
PATH=${WAS_DB2_PATH_VAR:+"$WAS_DB2_PATH_VAR":}"$PATH"
export PATH
export IBM_HEAPDUMP=TRUE
export IBM_HEAPDUMPDIR=/tmp
export IBM_JAVACOREDIR=/tmp
export IBM_COREDIR=/tmp
"$JAVA_HOME"/bin/java \
------------
Javacore, heapdump, core, snap traces will be created in the specified directory.
You can check if the location is changed, by killing java by "kill -11 <pid>.