PWC6345:调用javac有一个错误。使用Jetty WTP插件在Jetty上部署JSP页面时出现错误。

时间:2023-01-18 22:16:11

I'm trying to deploy a JSP-page on Jetty, using the Jetty WTP plugin for Eclipse. But I get the error below. It looks like Jetty can't find javac. Is there any settings I have to do for the Jetty WTP plugin in Eclipse or how do I fix this?

我正在尝试使用Jetty WTP插件在Jetty上部署JSP-page。但是我得到下面的错误。看起来Jetty找不到javac。对于Eclipse中的Jetty WTP插件,我需要做什么设置吗?

The JSP page works fine if I export my project as a .war-file to jetty\webapps and then start Jetty manually using java -jar start.jar. But it doesn't work if I deploy using the Jetty WTP plugin for Eclipse as described.

如果我将我的项目作为.war文件导出到jetty\webapps,然后使用java -jar start.jar手工启动jetty,那么JSP页面可以正常工作。但是如果我像描述的那样使用Jetty WTP插件为Eclipse部署的话,它将不起作用。

I have my JAVA_HOME set to C:\Program Files (x86)\Java\jdk1.7.0_01 and I use Jetty 8.0.4 on Windows 7.

我将JAVA_HOME C:\Program Files (x86)\Java\ jdk1.7.0_01我使用Jetty 8.0.4 Windows 7。

Servlets is working fine with the current setup. Any suggestions on how to solve this for JSP pages?

servlet在当前设置下运行良好。关于如何为JSP页面解决这个问题有什么建议吗?

HTTP ERROR 500
Problem accessing /MyJavaWeb/formProcess. Reason: 

    PWC6345: There is an error in invoking javac.  A full JDK (not just JRE) is required

Caused by:
org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac.  A full JDK (not just JRE) is required
    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:92)
    at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:378)
    at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:119)
    at org.apache.jasper.compiler.Jsr199JavaCompiler.compile(Jsr199JavaCompiler.java:208)
    at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:384)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:453)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:625)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:492)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:378)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:558)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:488)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:973)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:417)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:907)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
    at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:271)
    at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:98)
    at com.example.FormProcessServlet.doPost(FormProcessServlet.java:39)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:558)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:488)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:483)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:973)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:417)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:907)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
    at org.eclipse.jetty.server.Server.handle(Server.java:346)
    at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:442)
    at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:941)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
    at java.lang.Thread.run(Unknown Source)

14 个解决方案

#1


41  

As Jan Bartel suggested, from Jetty: How to configure JSP:

正如Jan Bartel所建议的,来自Jetty:如何配置JSP:

by adding the line below in the start.ini-file in Eclipse, it works fine.

在开头添加下面的行。在Eclipse中,它运行良好。

-Dorg.apache.jasper.compiler.disablejsr199=true

PWC6345:调用javac有一个错误。使用Jetty WTP插件在Jetty上部署JSP页面时出现错误。

#2


25  

I too happened to suddenly get the org.apache.jasper.JasperException: PWC6345 with my Eclipse installation and the Jetty Maven Plugin (which I use to start up Jetty from within Eclipse).

我也碰巧突然有了高潮。JasperException: PWC6345带有我的Eclipse安装和Jetty Maven插件(我使用这个插件在Eclipse中启动Jetty)。

The reason was that I updated my JDK installation shortly before. Inside Eclipse, this caused to change the "Installed JRE" to point to a plain JRE installation instead of a full-fledged JDK installation. A JDK installation is needed for Jasper, as Jasper needs javac (which is not provided by JRE).

原因是我不久前更新了JDK安装。在Eclipse中,这导致将“已安装的JRE”更改为指向普通的JRE安装,而不是完整的JDK安装。Jasper需要JDK安装,因为Jasper需要javac (JRE没有提供)。

In my case, the solution was to provide Eclipse with the JDK installation. To do so, select Window -> Preferences -> Java -> Installed JREs. Here, click Add..., then point to your JDK installation (in my case, JRE home should point to C:\Program Files (x86)\Java\jdk1.7.0_17). Click Finish. Then back in the Installed JREs overview, remove the old JRE reference and select the newly added JDK installation.

在我的例子中,解决方案是向Eclipse提供JDK安装。为此,选择Window ->首选项-> Java ->安装了JREs。在这里,单击Add……,然后指向您的JDK安装JRE(对我而言,家庭应该指向C:\Program Files (x86)\Java\ jdk1.7.0_17)。单击Finish。然后回到已安装的JREs概述中,删除旧的JRE引用并选择新添加的JDK安装。

#3


5  

I got the PWC6345 error when running a webapp with Run-Jetty-Run plugin.

在运行带有Run-Jetty-Run插件的web应用程序时,我得到了PWC6345错误。

The fix was to change the Execution environments settings in Preferences. Since I'm using java 7 I needed to change the setting for JavaSE-1.7. Probably other execution environments will behave similarly.

解决方案是更改首选项中的执行环境设置。由于我使用java 7,所以我需要更改javascript -1.7的设置。其他执行环境的行为可能类似。

Window -> Preferences -> Java -> Installed JREs -> Execution environments

窗口->首选项-> Java ->安装了JREs ->执行环境

Select JavaSE-1.7 on the left -> pick the *jdk*1.7.x_xx on the right hand side

在左边选择javascript -1.7 ->选择*jdk*1.7。x_xx在右边

#4


4  

Ok, solved this after a lot of searching around.

好吧,在搜索了很多之后解决了这个问题。

Download any jdk and point JAVA_HOME to this jdk. Inside this jdk folder you will find ./bin and ./jre/bin Copy the javac from ./bin and paste it in ./jre/bin [remember copy not cut]

下载任何jdk并将JAVA_HOME指向该jdk。在这个jdk文件夹中,您将找到。/bin和。/jre/bin复制。/bin中的javac,并将其粘贴到。/jre/bin[记住,不要剪切]

Now in eclipse, Run->External-Tools->External-Tools-Configurations, select the build.xml for of your project in the left pane and click on the JRE tab in the right pane. Click on installed JREs and add the jdk in the previous step. Once done, select this new JRE (jdk1.6.0_31) as the 'Separate JRE', click on apply at the bottom and run.

现在在eclipse中,运行->外部工具->外部工具-配置,选择构建。在左边窗格中的项目的xml,并单击右边窗格中的JRE选项卡。单击已安装的JREs,并在前面的步骤中添加jdk。完成后,选择这个新的JRE (jdk1.6.0_31)作为“单独的JRE”,在底部单击apply并运行。

This assumes you are doing a jetty:run using ant on eclipse.

这假定您正在做一个jetty:在eclipse上使用ant运行。

#5


3  

Strange because this thread suggests:

奇怪的是,这条线表明:

The solution was to install the package jdk7-openjdk.
Perhaps this should be added to the list of dependencies (or maybe for jetty, and not solr itself)?

解决方案是安装包jdk7-openjdk。也许这应该添加到依赖项列表中(或者可能是针对jetty,而不是solr本身)?

But that doesn't help much on Windows, where the binary for openjdk7 aren't easily available.
(In "OpenJDK availability for Windows OS" comments, eckes mentions having found some openjdk binaries for Windows, as part of the Build b146. However, said releases aren't maintained any more)

但这对Windows没有太大帮助,因为openjdk7的二进制代码不容易获得。(在“Windows OS的OpenJDK可用性”评论中,eckes提到已经为Windows找到了一些OpenJDK二进制文件,作为构建b146的一部分。不过,已表示不再维护版本)

The bug report filled by the OP Jonas is closed with a simple reference to the Eclipse wiki page "Jetty/Howto/Configure JSP".

OP Jonas填充的bug报告以对Eclipse wiki页面“Jetty/Howto/Configure JSP”的简单引用结束。

#6


3  

You have planty solutions guys but I thought that it exist a solution better than fix the start.ini

你们有很好的解决方案,但是我认为它存在一个比修复开始更好的解决方案

I lived the same problem and then I realize that it may be because I did have a JDK7 for 64bit while I should have a JDK7 for 32.

我也遇到过同样的问题,然后我意识到这可能是因为我有64位的JDK7而我应该有32位的JDK7。

So I fixed my problem by downloading and use the JDK7 for 32Bit.

所以我通过下载并使用JDK7来解决我的问题。

Also, you would still need to

而且,你仍然需要这样做

  • Use the JDK and not the JRE
  • 使用JDK而不是JRE
  • Set your JAVA_HOME
  • 设置JAVA_HOME

I am running on Windows by the way ...

顺便说一下,我在Windows上运行……

#7


3  

I have the same problem. When I run where java, the output is:

我也有同样的问题。在java运行时,输出为:

C:\Windows\System32\java.exe

C:\Windows\System32\java.exe

D:\Program Files\Java\jdk1.7.0_25\bin\java.exe

D:\程序文件\ Java \ jdk1.7.0_25 \ bin \ java.exe

Of course the first one is incorrect. So my problem lies in the PATH. I can rectify this by either removing the java.exe in the directory C:\Windows\System32\ because I'm sure it's useless, or putting the second entry in front of the first one.

当然第一个是错误的。我的问题在于路径。我可以通过删除java来纠正这个问题。exe的目录C:\Windows\System32\因为我相信它是无用的,或者把第二项前面的第一个。

So When encountering this problem, please check your PATH for the jdk. I hope that my problem and my solution is helpful in some way.

所以当遇到这个问题时,请检查jdk的路径。我希望我的问题和解决方案在某种程度上能有所帮助。

#8


2  

I got the PWC6345 error when running jetty-runner 9.2.1 standalone from Windows 7 cmd (or batch file) with Oracle JDK 1.7.0_60, and none of the other suggestions in this or other forums worked. I'll leave my workaround here, in case it helps someone...

我在运行jetty-runner 9.2.1独立于Oracle JDK 1.7.0_60的Windows 7 cmd(或批处理文件)时得到PWC6345错误,在这个或其他论坛中没有任何其他的建议有效。我要把我的工作留在这儿,以防万一。

After installing the JDK, running 'where java' showed two different java.exe paths, the first being in the Windows system folder, and the second in the JDK folder (which is the one I added to the path manually). Both of these are actually installed by the same JDK installer. The java.exe in the system folder was taking precedence and causing the full JDK to go undetected.

安装JDK之后,运行“where java”显示了两个不同的java。exe路径,第一个在Windows系统文件夹中,第二个在JDK文件夹中(这是我手工添加到路径中的路径)。这两个实际上都是由同一个JDK安装程序安装的。java。系统文件夹中的exe优先级更高,导致整个JDK未被检测到。

Placing the JDK bin folder (e.g. "C:\Program Files\java\jdk1.7.0_60\bin") on the path before the other system paths fixed the issue.

放置JDK bin文件夹(例如:“C:\程序文件\java\jdk1.7.0_60\bin”)在其他系统路径修复问题之前在路径上。

#9


0  

In addition to updating the JAVA_HOME (see above)... If you're encountering this error from command line (e.g. starting Jetty server from dos window), check where windows is finding the java.exe:

除了更新JAVA_HOME(参见上面)之外……如果您在命令行中遇到这个错误(例如从dos窗口启动Jetty服务器),请检查windows在哪里找到java.exe:

where java

在java

If windows comes back with a path showing to your jre, then check your PATH. Chances are the %PATH% contains a path pointing to the jre instead of jdk.

如果windows返回给您的jre的路径,那么检查您的路径。%PATH%可能包含指向jre而不是jdk的路径。

#10


0  

if you set environment variable JRE_HOME , please unset or delete it and start server again .

如果您设置了环境变量JRE_HOME,请取消或删除它并重新启动服务器。

#11


0  

In liferay 7 : I got this error fixed by changing the runtime environment of the server from jre to jre with jdk

在liferay 7中:我通过使用jdk将服务器的运行时环境从jre更改为jre,从而修复了这个错误

#12


0  

I got this error when deploy war package to our server.

我在将war包部署到服务器时出现了这个错误。

My deploy command is (applied web container you may find):

我的部署命令是(您可以找到应用web容器):

java  -jar jetty-runner.jar  --port 8020 xx.war

I write this answer because it confused me almost one day. I tried some methods above but failed.

我写下这个答案是因为有一天它把我搞糊涂了。我尝试了上面的一些方法,但是失败了。

Finally I found there is only jre on my servers but not full jdk.

最后,我发现我的服务器上只有jre,而没有完整的jdk。

$ls /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-2.b11.el7_3.x86_64
jre

I fix it with searching available jdk and install one.

我通过搜索可用的jdk和安装一个jdk来修复它。

$yum search java | grep 'java-'
$sudo yum install java-1.8.0-openjdk-devel.x86_64

(Notice the -devel)

(注意猛击)

#13


0  

I added this line to 'eclipse.ini' file which is present inside eclipse folder.

我在“eclipse”中添加了这一行。在eclipse文件夹中存在的ini文件。

-vm C:\Program Files\Java\jdk1.8.0_131\bin\javaw.exe

vm C:\Program Files\Java\ jdk1.8.0_131 \ bin \ javaw.exe

and I also change the JRE path in eclipse

我还更改了eclipse中的JRE路径

windows -> preferences -> java -> Installed JREs

windows ->首选项-> java ->安装了JREs

and provided path upto jdk

并提供到jdk的路径

C:\Program Files\Java\jdk1.8.0_131

C:\Program Files\Java\ jdk1.8.0_131

#14


-1  

I spent good amount of time on this issue, but it turned out to be very simple. All you have to do is:
choose the JDK instead of JRE while configuring the server runtime!

我在这个问题上花了很多时间,但结果很简单。您所要做的就是:在配置服务器运行时时,选择JDK而不是JRE !

It worked like a champ, I had this issue with glassFish 4.0

它像一个冠军,我有这个问题的玻璃鱼4.0。

#1


41  

As Jan Bartel suggested, from Jetty: How to configure JSP:

正如Jan Bartel所建议的,来自Jetty:如何配置JSP:

by adding the line below in the start.ini-file in Eclipse, it works fine.

在开头添加下面的行。在Eclipse中,它运行良好。

-Dorg.apache.jasper.compiler.disablejsr199=true

PWC6345:调用javac有一个错误。使用Jetty WTP插件在Jetty上部署JSP页面时出现错误。

#2


25  

I too happened to suddenly get the org.apache.jasper.JasperException: PWC6345 with my Eclipse installation and the Jetty Maven Plugin (which I use to start up Jetty from within Eclipse).

我也碰巧突然有了高潮。JasperException: PWC6345带有我的Eclipse安装和Jetty Maven插件(我使用这个插件在Eclipse中启动Jetty)。

The reason was that I updated my JDK installation shortly before. Inside Eclipse, this caused to change the "Installed JRE" to point to a plain JRE installation instead of a full-fledged JDK installation. A JDK installation is needed for Jasper, as Jasper needs javac (which is not provided by JRE).

原因是我不久前更新了JDK安装。在Eclipse中,这导致将“已安装的JRE”更改为指向普通的JRE安装,而不是完整的JDK安装。Jasper需要JDK安装,因为Jasper需要javac (JRE没有提供)。

In my case, the solution was to provide Eclipse with the JDK installation. To do so, select Window -> Preferences -> Java -> Installed JREs. Here, click Add..., then point to your JDK installation (in my case, JRE home should point to C:\Program Files (x86)\Java\jdk1.7.0_17). Click Finish. Then back in the Installed JREs overview, remove the old JRE reference and select the newly added JDK installation.

在我的例子中,解决方案是向Eclipse提供JDK安装。为此,选择Window ->首选项-> Java ->安装了JREs。在这里,单击Add……,然后指向您的JDK安装JRE(对我而言,家庭应该指向C:\Program Files (x86)\Java\ jdk1.7.0_17)。单击Finish。然后回到已安装的JREs概述中,删除旧的JRE引用并选择新添加的JDK安装。

#3


5  

I got the PWC6345 error when running a webapp with Run-Jetty-Run plugin.

在运行带有Run-Jetty-Run插件的web应用程序时,我得到了PWC6345错误。

The fix was to change the Execution environments settings in Preferences. Since I'm using java 7 I needed to change the setting for JavaSE-1.7. Probably other execution environments will behave similarly.

解决方案是更改首选项中的执行环境设置。由于我使用java 7,所以我需要更改javascript -1.7的设置。其他执行环境的行为可能类似。

Window -> Preferences -> Java -> Installed JREs -> Execution environments

窗口->首选项-> Java ->安装了JREs ->执行环境

Select JavaSE-1.7 on the left -> pick the *jdk*1.7.x_xx on the right hand side

在左边选择javascript -1.7 ->选择*jdk*1.7。x_xx在右边

#4


4  

Ok, solved this after a lot of searching around.

好吧,在搜索了很多之后解决了这个问题。

Download any jdk and point JAVA_HOME to this jdk. Inside this jdk folder you will find ./bin and ./jre/bin Copy the javac from ./bin and paste it in ./jre/bin [remember copy not cut]

下载任何jdk并将JAVA_HOME指向该jdk。在这个jdk文件夹中,您将找到。/bin和。/jre/bin复制。/bin中的javac,并将其粘贴到。/jre/bin[记住,不要剪切]

Now in eclipse, Run->External-Tools->External-Tools-Configurations, select the build.xml for of your project in the left pane and click on the JRE tab in the right pane. Click on installed JREs and add the jdk in the previous step. Once done, select this new JRE (jdk1.6.0_31) as the 'Separate JRE', click on apply at the bottom and run.

现在在eclipse中,运行->外部工具->外部工具-配置,选择构建。在左边窗格中的项目的xml,并单击右边窗格中的JRE选项卡。单击已安装的JREs,并在前面的步骤中添加jdk。完成后,选择这个新的JRE (jdk1.6.0_31)作为“单独的JRE”,在底部单击apply并运行。

This assumes you are doing a jetty:run using ant on eclipse.

这假定您正在做一个jetty:在eclipse上使用ant运行。

#5


3  

Strange because this thread suggests:

奇怪的是,这条线表明:

The solution was to install the package jdk7-openjdk.
Perhaps this should be added to the list of dependencies (or maybe for jetty, and not solr itself)?

解决方案是安装包jdk7-openjdk。也许这应该添加到依赖项列表中(或者可能是针对jetty,而不是solr本身)?

But that doesn't help much on Windows, where the binary for openjdk7 aren't easily available.
(In "OpenJDK availability for Windows OS" comments, eckes mentions having found some openjdk binaries for Windows, as part of the Build b146. However, said releases aren't maintained any more)

但这对Windows没有太大帮助,因为openjdk7的二进制代码不容易获得。(在“Windows OS的OpenJDK可用性”评论中,eckes提到已经为Windows找到了一些OpenJDK二进制文件,作为构建b146的一部分。不过,已表示不再维护版本)

The bug report filled by the OP Jonas is closed with a simple reference to the Eclipse wiki page "Jetty/Howto/Configure JSP".

OP Jonas填充的bug报告以对Eclipse wiki页面“Jetty/Howto/Configure JSP”的简单引用结束。

#6


3  

You have planty solutions guys but I thought that it exist a solution better than fix the start.ini

你们有很好的解决方案,但是我认为它存在一个比修复开始更好的解决方案

I lived the same problem and then I realize that it may be because I did have a JDK7 for 64bit while I should have a JDK7 for 32.

我也遇到过同样的问题,然后我意识到这可能是因为我有64位的JDK7而我应该有32位的JDK7。

So I fixed my problem by downloading and use the JDK7 for 32Bit.

所以我通过下载并使用JDK7来解决我的问题。

Also, you would still need to

而且,你仍然需要这样做

  • Use the JDK and not the JRE
  • 使用JDK而不是JRE
  • Set your JAVA_HOME
  • 设置JAVA_HOME

I am running on Windows by the way ...

顺便说一下,我在Windows上运行……

#7


3  

I have the same problem. When I run where java, the output is:

我也有同样的问题。在java运行时,输出为:

C:\Windows\System32\java.exe

C:\Windows\System32\java.exe

D:\Program Files\Java\jdk1.7.0_25\bin\java.exe

D:\程序文件\ Java \ jdk1.7.0_25 \ bin \ java.exe

Of course the first one is incorrect. So my problem lies in the PATH. I can rectify this by either removing the java.exe in the directory C:\Windows\System32\ because I'm sure it's useless, or putting the second entry in front of the first one.

当然第一个是错误的。我的问题在于路径。我可以通过删除java来纠正这个问题。exe的目录C:\Windows\System32\因为我相信它是无用的,或者把第二项前面的第一个。

So When encountering this problem, please check your PATH for the jdk. I hope that my problem and my solution is helpful in some way.

所以当遇到这个问题时,请检查jdk的路径。我希望我的问题和解决方案在某种程度上能有所帮助。

#8


2  

I got the PWC6345 error when running jetty-runner 9.2.1 standalone from Windows 7 cmd (or batch file) with Oracle JDK 1.7.0_60, and none of the other suggestions in this or other forums worked. I'll leave my workaround here, in case it helps someone...

我在运行jetty-runner 9.2.1独立于Oracle JDK 1.7.0_60的Windows 7 cmd(或批处理文件)时得到PWC6345错误,在这个或其他论坛中没有任何其他的建议有效。我要把我的工作留在这儿,以防万一。

After installing the JDK, running 'where java' showed two different java.exe paths, the first being in the Windows system folder, and the second in the JDK folder (which is the one I added to the path manually). Both of these are actually installed by the same JDK installer. The java.exe in the system folder was taking precedence and causing the full JDK to go undetected.

安装JDK之后,运行“where java”显示了两个不同的java。exe路径,第一个在Windows系统文件夹中,第二个在JDK文件夹中(这是我手工添加到路径中的路径)。这两个实际上都是由同一个JDK安装程序安装的。java。系统文件夹中的exe优先级更高,导致整个JDK未被检测到。

Placing the JDK bin folder (e.g. "C:\Program Files\java\jdk1.7.0_60\bin") on the path before the other system paths fixed the issue.

放置JDK bin文件夹(例如:“C:\程序文件\java\jdk1.7.0_60\bin”)在其他系统路径修复问题之前在路径上。

#9


0  

In addition to updating the JAVA_HOME (see above)... If you're encountering this error from command line (e.g. starting Jetty server from dos window), check where windows is finding the java.exe:

除了更新JAVA_HOME(参见上面)之外……如果您在命令行中遇到这个错误(例如从dos窗口启动Jetty服务器),请检查windows在哪里找到java.exe:

where java

在java

If windows comes back with a path showing to your jre, then check your PATH. Chances are the %PATH% contains a path pointing to the jre instead of jdk.

如果windows返回给您的jre的路径,那么检查您的路径。%PATH%可能包含指向jre而不是jdk的路径。

#10


0  

if you set environment variable JRE_HOME , please unset or delete it and start server again .

如果您设置了环境变量JRE_HOME,请取消或删除它并重新启动服务器。

#11


0  

In liferay 7 : I got this error fixed by changing the runtime environment of the server from jre to jre with jdk

在liferay 7中:我通过使用jdk将服务器的运行时环境从jre更改为jre,从而修复了这个错误

#12


0  

I got this error when deploy war package to our server.

我在将war包部署到服务器时出现了这个错误。

My deploy command is (applied web container you may find):

我的部署命令是(您可以找到应用web容器):

java  -jar jetty-runner.jar  --port 8020 xx.war

I write this answer because it confused me almost one day. I tried some methods above but failed.

我写下这个答案是因为有一天它把我搞糊涂了。我尝试了上面的一些方法,但是失败了。

Finally I found there is only jre on my servers but not full jdk.

最后,我发现我的服务器上只有jre,而没有完整的jdk。

$ls /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-2.b11.el7_3.x86_64
jre

I fix it with searching available jdk and install one.

我通过搜索可用的jdk和安装一个jdk来修复它。

$yum search java | grep 'java-'
$sudo yum install java-1.8.0-openjdk-devel.x86_64

(Notice the -devel)

(注意猛击)

#13


0  

I added this line to 'eclipse.ini' file which is present inside eclipse folder.

我在“eclipse”中添加了这一行。在eclipse文件夹中存在的ini文件。

-vm C:\Program Files\Java\jdk1.8.0_131\bin\javaw.exe

vm C:\Program Files\Java\ jdk1.8.0_131 \ bin \ javaw.exe

and I also change the JRE path in eclipse

我还更改了eclipse中的JRE路径

windows -> preferences -> java -> Installed JREs

windows ->首选项-> java ->安装了JREs

and provided path upto jdk

并提供到jdk的路径

C:\Program Files\Java\jdk1.8.0_131

C:\Program Files\Java\ jdk1.8.0_131

#14


-1  

I spent good amount of time on this issue, but it turned out to be very simple. All you have to do is:
choose the JDK instead of JRE while configuring the server runtime!

我在这个问题上花了很多时间,但结果很简单。您所要做的就是:在配置服务器运行时时,选择JDK而不是JRE !

It worked like a champ, I had this issue with glassFish 4.0

它像一个冠军,我有这个问题的玻璃鱼4.0。