CopyPastor

Detecting plagiarism made easy.

Score: 0.9172980950985036; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2023-11-21
by yegor256

Original Post

Original - Posted on 2023-11-21
by yegor256



            
Present in both answers; Present only in the new answer; Present only in the old answer;

You may try a combination of two open source libraries: [jaxec](https://github.com/yegor256/jaxec) and [jhome](https://github.com/yegor256/jhome) (I'm an author of them). This is how you call a Java program from your Java program:
``` import com.yegor256.Jaxec; import com.yegor256.Jhome;
// compile it first: new Jaxec() .with(new Jhome().path("bin/javac").toString()) .with("Hello.java") // the file name .exec();
// next, execute it: new Jaxec() .with(new Jhome().path("bin/java").toString()) .with("Hello") // the name of the class .exec(); ```
Behind the scene, it will find the location of `JAVA_HOME` and call `ProcessBuilder` to run two new processes.
You may try a combination of two open source libraries: [jaxec](https://github.com/yegor256/jaxec) and [jhome](https://github.com/yegor256/jhome) (I'm an author of them). This is how you call a Java program from your Java program:
``` import com.yegor256.Jaxec; import com.yegor256.Jhome;
new Jaxec() .with(new Jhome().path("bin/javac").toString()) .with("Hello.java") .exec(); new Jaxec() .with(new Jhome().path("bin/java").toString()) .with("Hello") // class name .exec(); ```
The absolute path of `bin/java` and `bin/javac` is calculated by `Jhome`.

        
Present in both answers; Present only in the new answer; Present only in the old answer;