I am making a java project that creates other java code, and I need it to compile it, and I need it to work on a system whether or not it has a compiler installed natively. How would I go about this? I cannot use ToolProvider.getSystemJavaCompiler();
from the JavaCompiler
library, because I cannot just assume that the user has a java compiler on their system.
Asked
Active
Viewed 23 times
-1

Aylias
- 1
- 1
1 Answers
-1
If you are talking about implementing code from other projects in your current project, create a Java package.
Otherwise...
Assuming you are using eclipse
Step #1. Right Click => Project
Step #2. Click Project Properties
Step #3. Click on Java Build Path
Step #4. Click the Projects Tab
Step #5. Click the Add Button
Step #6. Select the Project you want to add
Step #7. Click OK button

Coding Master
- 11
- 5
-
Question says *"java project that **creates** other java code"*. This is not about multi-module projects, it's about a Java program that generates Java source files and then needs to compile them immediately, so the newly generated code can be executed immediately. – Andreas Apr 15 '21 at 15:49