The java.ext.dirs trick doesn't seem to work anymore with OpenJDK 7u51
in unstable. When running sqlline with debugging enabled we get:

[debug] /usr/bin/sqlline: Runnning /usr/lib/jvm/default-java/bin/java
-Djava.ext.dirs=/usr/share/java/:/usr/local/share/java/ -classpath
/usr/share/java/jline.jar:/usr/share/java/sqlline.jar sqlline.SqlLine
Error: Could not find or load main class sqlline.SqlLine

I tried replacing the java.ext.dirs property with a classpath with a
wildcard, but it didn't work. With the classpath set to
/usr/share/java/* java fails to find the sqlline.SqlLine class. And with
a classpath set to /usr/share/java/sqlline.jar:/usr/share/java/* it
throws an IOException because it opens too many files:

$ java  -classpath '/usr/share/java/sqlline.jar:/usr/share/java/*'
sqlline.SqlLine Cannot run program "sh": error=24, Too many open files
        at java.lang.ProcessBuilder.start(
        at java.lang.Runtime.exec(
        at java.lang.Runtime.exec(
        at jline.UnixTerminal.exec(
        at jline.UnixTerminal.exec(
        at jline.UnixTerminal.stty(
        at jline.UnixTerminal.initializeTerminal(
        at jline.Terminal.setupTerminal(
        at sqlline.SqlLine$Opts.<init>(Unknown Source)
        at sqlline.SqlLine.<init>(Unknown Source)
        at sqlline.SqlLine.mainWithInputRedirection(Unknown Source)
        at sqlline.SqlLine.main(Unknown Source)
Caused by: error=24, Too many open files
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(
        at java.lang.ProcessImpl.start(
        at java.lang.ProcessBuilder.start(
        ... 11 more

The best we can do at this point is to list explicitly the known JDBC
drivers in the classpath. That's less flexible but it will be good
enough in most cases.

Emmanuel Bourg

This is the maintainer address of Debian's Java team
Please use for discussions and questions.

Reply via email to