No compiler detected, make sure you are running on top of a JDK instead of a JRE

Java 调 webservice 报如下错误

[2023-11-07 17:01:02.315] ERROR [scheduling-1] ToHisApiImpl.java:106 - No compiler detected, make sure you are running on top of a JDK instead of a JRE.
java.lang.IllegalStateException: No compiler detected, make sure you are running on top of a JDK instead of a JRE.
    at org.apache.cxf.common.util.Compiler.useJava6Compiler(Compiler.java:193)
    at org.apache.cxf.common.util.Compiler.compileFiles(Compiler.java:141)
    at org.apache.cxf.common.util.Compiler.compileFiles(Compiler.java:136)
    at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.compileJavaSrc(DynamicClientFactory.java:639)
    at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:389)
    at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:244)
    at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:237)
    at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:192)
    at com.vipsoft.his.hospital.service.impl.GoodwillcisServiceImpl.archiveFile(GoodwillcisServiceImpl.java:85)
    at com.vipsoft.his.hospital.service.impl.ToHisApiImpl.syncReport(ToHisApiImpl.java:92)
    at com.vipsoft.his.hospital.schedule.HisTaskJob.syncReport(HisTaskJob.java:38)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84)
    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
    at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

安装 JDK 默认使用 JRE 环境,新增 JAVA_HOME 环境变量,指向 JDK 目录即可

新增 JAVA_HOME 环境变量

image

修改 Path 环境变量

image

如果还是不行,修改运行命令
java -jar XXX.jar
改成
"%JAVA_HOME%/BIN/JAVA" -jar XXX.jar
(XXX为你自己打包好的jar包名称)

posted @   VipSoft  阅读(201)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· 清华大学推出第四讲使用 DeepSeek + DeepResearch 让科研像聊天一样简单!
· 实操Deepseek接入个人知识库
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
历史上的今天:
2022-11-08 Kubernetes(K8S) 镜像拉取策略 imagePullPolicy
2020-11-08 忘了 iOS(iPad、IPhone) 设备上的「屏幕使用时间」密码怎么办?找回屏幕密码
2014-11-08 WPF Image控件 Source: Byte[] ,BitmapImage 相互转换
2012-11-08 找不到请求的 .Net Framework Data Provider。可能没有安装
点击右上角即可分享
微信分享提示