0

I have Oracle JDK 8 installed and SQLcl of version 21.3. I want to run simple js script but SQLcl cannot find js engine.

I run SQLcl from PowerShell under Windows 10:

PS C:\run_scripts_sqlcl> sql /nolog
Picked up JAVA_TOOL_OPTIONS: -Duser.language=en


SQLcl: Release 21.3 Production on Thu Nov 04 00:32:25 2021

Copyright (c) 1982, 2021, Oracle.  All rights reserved.

SQL> show java
Java Detail
-----------
java.home= C:\Program Files\Java\jdk1.8.0_311\jre
java.vendor= Oracle Corporation
java.vendor.url= http://java.oracle.com/
java.version= 1.8.0_311
--------------------------------------------------------------------------------
os.arch= amd64
os.name= Windows 10
os.version= 10.0
path.separator= ;
file.separator= \
line.separator=

user.dir= C:\run_scripts_sqlcl
user.home= C:\Users\user
user.name= Roman.Shiryaev
user.language= en
user.region= null
file.encoding= Cp1251
Used memory: 57.2MB
Max available memory: 1,820.5MB
--------------------------------------------------------------------------------
SQL_HOME=null
Classpath

--------------------------------------------------------------------------------
null
SQL> script
  2  print('hi');
  3* /
js language engine not found
Please add js language engine to the classpath
SQL>

Seems like I haven't configured something properly but I can't find any information about configuring SQLcl for running scripts. I've tried to set env variable CLASSPATH to %JDK_HOME%/bin but it didn't help. Any tips would be appreciated.

Roman
  • 473
  • 5
  • 22

1 Answers1

0

After contacting Oracle Support they advised the following:

  • Remove all existing Javas, especially installed via installer
  • Download Java 11 JDK
  • Place it in a folder jdk on the same level as sqlcl
  • Create jre folder inside of jdk and copy contents of jdk folder into jre one

After such action it finally managed to run scripts. Seems like very confusing for resolving Java path under Windows as it doesn't resolve it from PATH variable or JAVA_HOME.

Roman
  • 473
  • 5
  • 22