Discussions
Categories
- 197.2K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.8K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 555 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.4K SQL Developer
- 296.3K Development
- 17 Developer Projects
- 139 Programming Languages
- 293K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 158 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 468 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
SQLcl.exe giving Java error Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not loa
Hello Folks,
I am trying to connect sqlcl to our database but its giving me the error below -
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no jansi in java.library.path, Access is denied]
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:37)
at oracle.dbtools.raptor.console.clone.DbtoolsConsoleReader.<init>(DbtoolsConsoleReader.java:245)
at oracle.dbtools.raptor.console.clone.DbtoolsConsoleReader.<init>(DbtoolsConsoleReader.java:238)
at oracle.dbtools.raptor.console.SQLPlusConsoleReader.<init>(SQLPlusConsoleReader.java:35)
at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.startConsole(SqlCli.java:235)
at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.<init>(SqlCli.java:216)
at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.main(SqlCli.java:427)
I have jre1.8.0_161 folder in the sqlcl folder. I have got the Java_Home link to sqlcl/jre1.8.0_161 and I in my path variable i have added %JAVA_HOME%\bin. I am lost at why its giving me this error. Any help is appreciated. Thank you!
Answers
-
SQLcl will first look for the existence of sqlcl\jre, not sqlcl\jre<specific_version>. So you need something like...
The list of rules are in , shown below for convenience (Windows)...
1. If a JRE is copied into a sqlcl\jre folder, then SQLcl uses that Java version.2. Otherwise, running sql.bat uses an explicitly set JAVA_HOME, followed by the Java version appearing first in PATH.3. Otherwise, running sql.exe first checks the Windows Registry for which Java version to use, then falls through to the rules in (2).
-
In addition, make sure your SQLcl install contains the file jline.jar in the sqlcl\lib directory. That is where the jansi stuff resides. Perhaps the utility you used to extract from the sqlcl zip did not do the job properly.
-
Thank you Gary for the response. I checked for jline.jar and it is there. Please forgive me for my silly question but here it goes - In your first comment you mentioned JRE should be in the path of SQLcl and that makes sense. I changed the name of JRE folder to just "JRE" instead of JRE<version>, however, should the SQLcl's lib and bin files reside IN the JRE bin files? That doesn't make sense right? I guess I am confused in where the SQLcl's lib & bin files should reside in order for it to work. Again, thanks for your help!
-
No worries. I also should have provide this screenshot of the folder structure at the next level up, the level where the embedded jre folder is a sibling of the lib and bin folders that come with SQLcl. The jre, of course, has its own bin and lib folders, as shown in my prior post.
So renaming that JRE<version> to simply JRE is what I intended.
-
Thanks for the response Graham. I re installed/extracted SQLcl to my program files. Grabbed JRE folder and stuck it as a sibling in the SQLcl folder like this:
And then went to the SQLcl's bin folder where my sql.exe and sql.bat files are residing and tried to run sql but I get the same error.
-
I have SQLDeveloper set up and it works fine. I read somewhere that sqlcl comes with the developer and so I started looking for it and there it was. The sql.exe and sql.bat files were in my C:\Program Files\sqldeveloper\sqldeveloper\bin folder. So I tried to run it from there and I got the same error as above. This is very strange!
-
Here is the screenshot:
-
I agree, this is very strange. I have a superstition about never installing SQLcl or SQL Developer under C:\Users or C:\Program Files, but I doubt that is causing you any problems because I can launch SQLcl in either scenario...
And if you actually could open SQLcl successfully and run the show java command, you would see jline.jar in the ClassPath...
There must be something configured incorrectly in your environment, but I am at a bit of a loss what that might be.
-
As an alternative, you might want to try launching SQLcl with the sql.bat command. And, in fact, I do see something strange in your last screenshot: why is sql.exe dated today at 01/31/2018 9:15 AM?
-
Tried sql.bat - a window comes up for less than a second and goes away. I think since I tried to run sql.exe today its dating today.