Class.forName?

Tom McGinn tom.mcginn at oracle.com
Fri Jan 31 15:43:42 PST 2014


Hello -

I am trying to create a JS file that illustrates using Java classes 
mixed with JS.

I am trying to connect to the sample JavaDB instance, but am not able to 
load the driver class.

jjs -cp /home/tmcginn/jdk1.8.0/db/lib/derbyclient.jar
jjs> var driver = "org.apache.derby.jdbc.ClientDriver";
jjs> Java.type("java.lang.Class").forName(driver);
java.lang.RuntimeException: java.lang.ClassNotFoundException: 
org.apache.derby.jdbc.ClientDriver

I think I am missing something obvious....

I am running this on Oracle Linux 6 u3 on an OVM.

Thanks,

Tom

-- 


Tom McGinn | Java Curriculum Developer
OracleServer Technologies Curriculum Development
Phone: +1.781.442.0621
Mail: tom.mcginn at oracle.com
Blog: Java Training Beat <https://blogs.oracle.com/javatraining/>



More information about the nashorn-dev mailing list