oracle / oracle-db-tools

This project is a repository of sample code that will demonstrate various concepts to assist developers in building applications around Oracle Database technologies. SDKs and scripts will be available to integrate with SQL Developer, Data Modeler, Oracle REST Data Services and DBaaS.
MIT License
277 stars 110 forks source link

no jansi in java.library.path #25

Closed ghost closed 5 years ago

ghost commented 5 years ago

jansi is the cause

Running bin/sql on OpenBSD:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no jansi in java.library.path]
        at org.fusesource.hawtjni.runtime.Library.doLoad(Library.java:182)
        at org.fusesource.hawtjni.runtime.Library.load(Library.java:140)
        at org.fusesource.jansi.internal.CLibrary.<clinit>(CLibrary.java:42)
        at org.fusesource.jansi.AnsiConsole.wrapOutputStream(AnsiConsole.java:48)
        at org.fusesource.jansi.AnsiConsole.<clinit>(AnsiConsole.java:38)
        at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.main(SqlCli.java:435)

running manually

sqlcl -debug expands to:

java -Djava.awt.headless=true \
-Dapple.awt.UIElement=true \
-Djava.library.path=/usr/local/lib:/home/regular/sqlcl/lib \
-verbose \
-Xss10M \
-client \
-cp /home/user/sqlcl/lib/dbtools-sqlcl.jar:\
/home/user/sqlcl/lib/drivers/*:\
/home/user/sqlcl/lib/ext/*:\
/home/user/sqldev/sqldeveloper/rdbms/jlib/xdb6.jar:\
/home/user/sqldev/sqldeveloper/jdbc/lib/ojdbc8.jar:\
/home/user/sqldev/sqldeveloper/jlib/orai18n-utility.jar:\
/home/user/sqldev/sqldeveloper/jlib/orai18n-mapping.jar:\
/home/user/sqldev/sqldeveloper/jlib/orai18n.jar:\
/home/user/sqldev/sqldeveloper/modules/oracle.xdk/xmlparserv2.jar:\
/home/user/sqlcl/lib/javax.json.jar:\
/home/user/sqlcl/lib/javax.json-api.jar:\
/home/user/sqlcl/lib/xmlparserv2.jar:\
/home/user/sqlcl/lib/commons-logging.jar:\
/home/user/sqlcl/lib/orai18n.jar:\
/home/user/sqlcl/lib/xmlparserv2-sans-jaxp-services.jar:\
/home/user/sqlcl/lib/orai18n-collation.jar:\
/home/user/sqlcl/lib/jackson-databind.jar:\
/home/user/sqlcl/lib/xdb6.jar:\
/home/user/sqlcl/lib/jackson-core.jar:\
/home/user/sqlcl/lib/stringtemplate.jar:\
/home/user/sqlcl/lib/oraclepki.jar:\
/home/user/sqlcl/lib/jackson-annotations.jar:\
/home/user/sqlcl/lib/osdt_core.jar:\
/home/user/sqlcl/lib/httpmime.jar:\
/home/user/sqlcl/lib/osdt_cert.jar:\
/home/user/sqlcl/lib/httpcore.jar:\
/home/user/sqlcl/lib/orajsoda.jar:\
/home/user/sqlcl/lib/httpclient.jar:\
/home/user/sqlcl/lib/orai18n-utility.jar:\
/home/user/sqlcl/lib/ojdbc8.jar:\
/home/user/sqlcl/lib/dbtools-sqlcl.jar:\
/home/user/sqlcl/lib/dbtools-net.jar:\
/home/user/sqlcl/lib/dbtools-http.jar:\
/home/user/sqlcl/lib/dbtools-common.jar:\
/home/user/sqlcl/lib/orai18n-servlet.jar:\
/home/user/sqlcl/lib/jsch.jar:\
/home/user/sqlcl/lib/commons-codec.jar:\
/home/user/sqlcl/lib/jdbcrest.jar:\
/home/user/sqlcl/lib/orai18n-mapping.jar:\
/home/user/sqlcl/lib/jline.jar:\
/home/user/sqlcl/lib/antlr-runtime.jar:\
/home/user/sqlcl/lib/jansi.jar \
oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli

The whole output this command produces (stout, stderr) is here.

I have devel/jdk installed.

I can see jansi.jar and jline.jar present in lib/.

I have added -verbose and changed .. to sqldeveloper which is also installed in home directory under sqldev/, but i don't know if it is helping (if sqlcl requires sqldeveloper).

bamcgill commented 5 years ago

if you add this to SQLCL_HOME/bin/sql CPLIST="$SQL_HOME/lib/jansi.jar:$CPLIST" at line 157, ie at the end of function setupCPLIST, it will push jansi onto the active class path, rather than at the end. This will help you move forward. I have a fixed merged for 19.1.0 release. This also appears on Solaris too.