使用documents4j将Doc转换为PDf

问题描述:

我想尝试使用documents4j将文档转换为PDF。我按照这些说明 http://documents4j.com/#/develop 。当我输入 mvn package 然后按回车,一切似乎都很好,但我得到这个

I wanted to try to use documents4j in order to convert a doc to PDF. I follow these instructions here http://documents4j.com/#/develop. When I type mvn package and then press enter, everything seems to work well, but I got this

C:\Users\Fabio\Downloads\docs-to-pdf-converter-master\docs-to-pdf-converter-master\docs-to-pdf-converter\documents4j [ma
ster +0 ~0 -237 | +24 ~0 -0 !]>     mvn package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] documents4j
[INFO] documents4j-api
[INFO] documents4j-util-all
[INFO] documents4j-transformer-api
[INFO] documents4j-transformer
[INFO] documents4j-util-conversion
[INFO] documents4j-test
[INFO] documents4j-local
[INFO] documents4j-util-transformer-process
[INFO] documents4j-transformer-msoffice
[INFO] documents4j-transformer-msoffice-base
[INFO] documents4j-transformer-msoffice-test
[INFO] documents4j-transformer-msoffice-word
[INFO] documents4j-transformer-msoffice-excel
[INFO] documents4j-local-demo
[INFO] documents4j-util-ws
[INFO] documents4j-client
[INFO] documents4j-util-standalone
[INFO] documents4j-client-standalone
[INFO] documents4j-server
[INFO] documents4j-server-standalone
[INFO] documents4j-aggregation
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building documents4j 1.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-checkstyle-plugin:2.12.1:check (validate) @ documents4j-parent ---
[INFO] Starting audit...
Audit done.

[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building documents4j-api 1.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-checkstyle-plugin:2.12.1:check (validate) @ documents4j-api ---
[INFO] Starting audit...
Audit done.

[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ documents4j-api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Fabio\Downloads\docs-to-pdf-converter-master\docs-to-pdf-converter-m
aster\docs-to-pdf-converter\documents4j\documents4j-api\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ documents4j-api ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 16 source files to C:\Users\Fabio\Downloads\docs-to-pdf-converter-master\docs-to-pdf-converter-master\d
ocs-to-pdf-converter\documents4j\documents4j-api\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] documents4j ........................................ SUCCESS [  2.079 s]
[INFO] documents4j-api .................................... FAILURE [  1.119 s]
[INFO] documents4j-util-all ............................... SKIPPED
[INFO] documents4j-transformer-api ........................ SKIPPED
[INFO] documents4j-transformer ............................ SKIPPED
[INFO] documents4j-util-conversion ........................ SKIPPED
[INFO] documents4j-test ................................... SKIPPED
[INFO] documents4j-local .................................. SKIPPED
[INFO] documents4j-util-transformer-process ............... SKIPPED
[INFO] documents4j-transformer-msoffice ................... SKIPPED
[INFO] documents4j-transformer-msoffice-base .............. SKIPPED
[INFO] documents4j-transformer-msoffice-test .............. SKIPPED
[INFO] documents4j-transformer-msoffice-word .............. SKIPPED
[INFO] documents4j-transformer-msoffice-excel ............. SKIPPED
[INFO] documents4j-local-demo ............................. SKIPPED
[INFO] documents4j-util-ws ................................ SKIPPED
[INFO] documents4j-client ................................. SKIPPED
[INFO] documents4j-util-standalone ........................ SKIPPED
[INFO] documents4j-client-standalone ...................... SKIPPED
[INFO] documents4j-server ................................. SKIPPED
[INFO] documents4j-server-standalone ...................... SKIPPED
[INFO] documents4j-aggregation ............................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.037 s
[INFO] Finished at: 2015-12-16T12:36:18+01:00
[INFO] Final Memory: 17M/181M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project d
ocuments4j-api: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :documents4j-api

我试图删除C:\Users\My User.m2文件夹,但它不工作。
对于容易的问题我很抱歉,但我对于maven非常新,我不知道哪个可能是问题,也许在documents4j-api中的pom.xml?

I tried to delete C:\Users\My User.m2 folder but it doesn't work. I'm sorry for the easy question but I'm very new about maven and I don't know which could be the problem, maybe about pom.xml in documents4j-api?

您的 JAVA_HOME 指向 不是一个 JDK 。更改 JAVA_HOME 变量,它应该工作

Your JAVA_HOME point to a jrenot to a JDK. Change the JAVA_HOME variable and it should work