简体   繁体   English

使用document4j将Doc转换为PDf

[英]Convert Doc to PDf with documents4j

I wanted to try to use documents4j in order to convert a doc to PDF. 我想尝试使用documents4j来将doc转换为PDF。 I follow these instructions here http://documents4j.com/#/develop . 我在这里http://documents4j.com/#/develop遵循这些说明。 When I type mvn package and then press enter, everything seems to work well, but I got this 当我键入mvn package并按回车键时,一切似乎都正常运行,但是我明白了

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

I tried to delete C:\\Users\\My User.m2 folder but it doesn't work. 我试图删除C:\\ Users \\ My User.m2文件夹,但是它不起作用。 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? 对于这个简单的问题,我感到很抱歉,但是我对maven还是很陌生,我不知道这可能是问题所在,也许是关于documents4j-api中的pom.xml?

Your JAVA_HOME point to a jre not to a JDK . 您的JAVA_HOME指向jre而不是JDK Change the JAVA_HOME variable and it should work 更改JAVA_HOME变量,它应该可以工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM