After the Java Web is deployed to tomcat, the solution of the related class cannot be found using dynamic compilation

1. Problems

  When dynamically compiling a java file (although this java file references a third-party jar package), if this process occurs in the java command line program, it will be compiled normally. If it happens in JavaWeb, and after this Java is deployed to Tomcat, when dynamic compilation is performed, it will prompt that the relevant class or Jar cannot be found.

2. Solutions

  Copy the dependent Jar files to the %JAVA_Home%\jre\lib\ext directory. For example: C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext and restart Tomcat.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325126450&siteId=291194637