Sometimes error messages are very misleading. If you see an error stating: Exception in thread "main" you expect that this is some java-related issue. Maybe the classpath is wrong, your JAVA_HOME is not set, etc. I had this error when I was starting up the Oracle dbca. After some checks and different tries I found out that the DISPLAY environment was set, but to a different screen, which I was not using. So even when you check the dbca shell script, you will find a build-in check for the DISPLAY environment. But now the check passed with flying flags - as it was set. The problem that my dbca was unable to use this DISPLAY lead to the java error. Setting the DISPLAY to the one I was using (and setting xhost to allow all) solved this.
Some of the stuff I do for a living. This mainly concerns working with Oracle Databases and Application Servers. Lately I picked up AWS, Azure and OCI.