0

I have simple structure:

./out - binary
./src - source

At src I have Main.java, where very simple code:

public class Main {
    public static void main(String[] args) {
         System.out.println("Hello World");
    }
}

I try to compile, with ProcessBuilder, there is lines of commands:

new EnhancedProcess("javac",
            "-d", Project.getPathOut(),
            "@" + Project.getPathOut() + File.separator + "source.txt").start();

javac -d /home/username/projects/zxcf/out @/home/username/projects/zxcf/out/source.txt

source.txt has lines, where catched *.java files:

/home/username/projects/zxcf/src/Main.java

And catch issue:

/home/username/projects/zxcf/src/Main.java:1: error: class, interface, or enum expected Main.java
^
1 error

What is this can be?

MrChebik
  • 21
  • 6
  • Looks like it does not understand the @. Have you tried putting the `-d /home/username/projects/zxcf/out ` in your source.txt file so that javac only has one option? BTW, what is `EnhancedProcess`? – StephaneM Aug 31 '17 at 10:51
  • `EnhancedProcess` -- custom class, where I give him commands and at start method, `ProcessBuilder` run this commands with preferred settings such as catching any errors, etc. – MrChebik Aug 31 '17 at 10:54
  • Haven't tried, I try to do, how in this answer: https://stackoverflow.com/questions/17140512/how-to-compile-multiple-java-files-when-there-are-java-files-in-other-packages – MrChebik Aug 31 '17 at 10:57
  • After putting this lines, I have same effect. – MrChebik Aug 31 '17 at 11:03

0 Answers0