This error message occurs if you try to start Java Workshop by linking from /opt/bin/jws to /opt/SUNWjws/JWS/sparc-S2/bin/jws. Typing the full path name works, but typing jws gives this error.
This error occurs because /opt/bin/jws is not /opt/SUNWjws/JWS/sparc-S2/bin/jws, which is a script that runs another script: $_SS_JWS_HOME/solaris/bin/locate_dirs.
/opt/bin/jws is not setting $_SS_JWS_HOME correctly. Remove it from the path and replace it with /opt/SUNWjws/JWS/sparc-S2/bin/jws. Then, which jws can return /opt/SUNWjws/JWS/sparc-S2/bin/jws.