How to get the start time for a JAVA Main running process

I have a script that executes a MAIN JAVA FILE

It does check if the process is already running or not by using this code

w_pid=`ps -efx | grep -v grep | grep "FileTransactionArchiveMain dvlp"|awk '{print $11}'`
if [ "$w_pid" != "" ]
then
    #echo 'Another instance is running.'
    exit
fi

Now I have to find when that process had started.

for finding a batch file start time i used this

VAR=$(ps -ef | grep batch_proc_x | grep -v grep)

batch_proc_x is a script file.

but if I use the same code for FileTransactionArchiveMain VAR returns null or blank.

how do I get the start time for FileTransactionArchiveMain?

On the one hand, your existing check for an existing process looks a bit scary, but if it works so be it; although I'd ask what happens if the Java is started with another argument count?

Meanwhile, since you're trying to reuse code that works in one situation and doesn't seem to in a seemingly similar one, I'd suggest you break your existing variable down and observe it's various pipeline steps left to right to get familiar with what it's doing. You might notice that one of the columns involved with the ps command reflects the Start Time and/or Date. You might also note that your second scenario is not carrying all that many parameters, and misses the 11th one that the Java job is using.

This approach will allow you to fine tune the specifics of the scenario that you're checking...but it will also help you to get familiar with the code you're trying to use...re-use.