This week's book giveaways are in the Jython/Python and Object-Oriented programming forums. We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line! See this thread and this one for details.
I am having some trouble trying to compile main java files with separate class files using the java compiler API.
The code that I have pasted is working for java files which does not require other class files (stand alone java files). However, I needed a code which can compile main java files that uses other class files separated from each other.
I always get the "cannot find symbol error" (compilation error) as it is not able to compile the file with other class files even though all the files (Java main and class files) are in the same folder.
I have also thought of another way which is to compile my code using by executing windows command prompt window using java code which I do not have no idea on how to do it. (I would appreciate if anyone thinks this is a better way and share ideas on how to do this.)
Seems to me you would have to specify the classpath somewhere, if you're trying to compile code which depends on other classes. I'm not familiar with the JavaCompiler type but it's clear to me that nothing in your code specifies a classpath.
We're being followed by intergalactic spies! Quick! Take this tiny ad!