Java Derby DB is perfectly working on Virtual Mac but not on Physical Mac

I developed a Java Application to run on Mac BigSur. I used Java Derby as database for this application. The Application gives an Exception:

java.lang.ClassNotFoundException:org.apache.derby.jdbc.EmbeddedDriver

The interesting fact is that When I run this application on my MacBigSur(Which I have installed on Virtual Box) then the application runs perfectly. But when I run the application on Physical Mac BigSur, then it gives the above mentioned exception.
I am pasting the code Iused for Creating connection to Database.

String dbdriver = "org.apache.derby.jdbc.EmbeddedDriver";
Class.forName(dbdriver).newInstance();
con = DriverManager.getConnection("jdbc:derby:/users/daniyalumar/4DSOFTECHDB; create = true");