Closed jhemann closed 6 years ago
Thanks for this. Will look into it soon-ish...
Hi, I had the same issue, here's a working project.clj under:
;; CIDER 0.17.0snapshot (package: 20180219.1846), nREPL 0.2.12 ;; Clojure 1.9.0, Java 9.0.1 (oracle sdk under win10)
(defproject cloj "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "http://example.com/FIXME" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :main cloj.core :jvm-opts ["-Xmx1g" "--add-modules" "java.activation"] :dependencies [[org.clojure/clojure "1.9.0"] [clj-time "0.14.2"] [pdfboxing "0.1.13"] [org.clojure/data.codec "0.1.1"]])
Disregard the Xmx1g, but the other jvm-options is what was required to make use of pdfboxing.
Hope it's of use for you (and thanks for your lib)
I have added JDK9 to travis CI and fixed the error by replacing Preflight parser with PDF parser but I am not sure if there are any edge cases and the rationale behind using PreFlight parser. This passes the tests on JDK 9. But I don't any other cases that are handled but don't have tests.
This PR https://github.com/dotemacs/pdfboxing/pull/21 would also remove this JDK9 specific error since it removes preflight as a dependency that uses javax components.
Hi @jhemann and @agumonkey
can you confirm that this change by @tirkarthi which I just merged solves the issue for you?
Thanks
I'd gladly try but where do I get the latest build jar ?
I think you can do a clone and do lein install
from the cloned directory to install it. I hope this project works with deps.edn which will be a good way to test this too.
Hey @agumonkey
you can do what @tirkarthi suggested, but if you haven't already, I just pushed: 0.1.14.1-SNAPSHOT for you to try.
Let me know how you get on.
I just tried it with Java 9 & Clojure 1.9.0.
I created deps.edn with this content:
{:deps
{pdfboxing {:mvn/version "0.1.14.1-SNAPSHOT"}}}
And then I ran:
$ clj
Downloading: pdfboxing/pdfboxing/0.1.14.1-SNAPSHOT/maven-metadata.xml from https://clojars.org/repo/
Downloading: pdfboxing/pdfboxing/0.1.14.1-SNAPSHOT/pdfboxing-0.1.14.1-20180224.071331-1.pom from https://clojars.org/repo/
Downloading: pdfboxing/pdfboxing/0.1.14.1-SNAPSHOT/pdfboxing-0.1.14.1-20180224.071331-1.jar from https://clojars.org/repo/
Clojure 1.9.0
user=> (require '[pdfboxing.text :as text] :verbose)
(clojure.core/load "/pdfboxing/text")
(clojure.core/in-ns 'clojure.core.specs.alpha)
(clojure.core/alias 's 'clojure.spec.alpha)
(clojure.core/load "/pdfboxing/common")
(clojure.core/in-ns 'pdfboxing.common)
(clojure.core/alias 'io 'clojure.java.io)
(clojure.core/in-ns 'pdfboxing.text)
(clojure.core/alias 'common 'pdfboxing.common)
(clojure.core/in-ns 'user)
(clojure.core/alias 'text 'pdfboxing.text)
nil
user=> (text/extract "/Users/alex/dev/clojure/pdfboxing/test/pdfs/hello.pdf")
"Hello, this is pdfboxing.text\n"
i couldn't use deps.edn on my laptop right now; but using your latest 0.1.14.1-SNAPSHOT I could use you code without an issue on two random PDFs.
Thanks a lot
Thank you @jhemann @agumonkey for bringing this up and @tirkarthi for solving it.
I'll close this issue now.
OS: Linux Mint (Sarah)
Using this project.clj
I get the following error under Java 9:
The issue seems to be that
java.activation
is deprecated in Java 9, see this issue.I briefly tried downloading the JavaBeans Activation Framework and using the
--add-modules
argument to:jvm-opts
in my profile, but gave up. Instead, when usingpdfboxing
I reverted to Java 8 viaNow, starting a REPL and bringing in pdfboxing works: