Topic: Spring AND ToolProvider.getSystemJavaCompiler ()

The question which has ripened on traces here of it the Author: Artem Korneev Date: 20.06 09:01. For the assembly of a plug-in from source codes in  while I try to use Java Compiler API, the blessing it all the same goes "from a box" and does not demand any additional . All sorcery begins with a simple line: var compiler = ToolProvider.getSystemJavaCompiler (); Well and, actually, here here problems also begin. In the test console application - all works, the call returns the link to any object. To use that object yet did not try, but the link not the zero. The exactly same line of the code launched in application on Spring, returns null. Well, probably, it is logical - the application launched through Spring, most likely, has any restrictions in respect of access to the main system. Safety there and here it here all. Actually, a question. As though all necessary surrounding to "pack" into the Spring-appendix that it earned all? In the documentation to Java Compiler API it is said that it goes with JDK.compiler unit: https://docs.oracle.com/javase/10/docs/ … mmary.html Well or though stick, in what side to read. In internal knowledge Spring - it is not strong yet. Actually, therefore I am picked with these experiments that it is better to understand these nuances.


Re: Spring AND ToolProvider.getSystemJavaCompiler ()

Cannot be such, what Spring it is launched by means of JRE, instead of JDK? Hardly there any restrictions, same not applets.


Re: Spring AND ToolProvider.getSystemJavaCompiler ()

Hello, vsb, you wrote: vsb> cannot be such, what Spring it is launched by means of JRE, instead of JDK? Precisely! Thanks. I launched so: java-jar appname.jar Now launched so that it was in an explicit form used JDK: C:\Program Files\Java\jdk-10\bin\java-jar appname.jar And all earned at once.