0
  1. These errors have been generated when running a chatbot java program on windows platform in the Netbeans IDE.
  2. Maybe I am missing the build path for some process.

    java.io.IOException: Cannot run program "clear": CreateProcess error=2, The system cannot find the file specified
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
            at java.lang.Runtime.exec(Runtime.java:620)
            at java.lang.Runtime.exec(Runtime.java:450)
            at java.lang.Runtime.exec(Runtime.java:347)
            at chatbot.chatbot.main(chatbot.java:29)
    Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
            at java.lang.ProcessImpl.create(Native Method)
            at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
            at java.lang.ProcessImpl.start(ProcessImpl.java:137)
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
            ... 4 more
    
    
    
    BUILD SUCCESSFUL (total time: 4 seconds)
    

    Can anyone please provide me a solution to this problem..

iamnexxed
  • 15
  • 6
  • What are the path settings for Java on the machine? – CoupFlu Oct 24 '18 at 18:01
  • Did you mean environment variables? – iamnexxed Oct 24 '18 at 18:16
  • Yeah, basically Java can't find the Classes. They probably aren't in the default directory listed on your path. You could try specifying the directory if you are using command line – CoupFlu Oct 24 '18 at 18:26
  • 1
    @JamieSnipes it looks like the OP is trying to run the operating system command `clear` which doesn't have anything to do with classes/classpath. This would be the operating system `Path` environment variable. The `clear` command on Linux/macOS clears the screen, Windows doesn't have an equivalent command (it has `cls`, but this isn't a command, but a shell built-in). OP, if you're trying to clear the terminal in your application check out [this answer](https://stackoverflow.com/a/33379766/9973881). – Michael Powers Oct 24 '18 at 19:38
  • @MichaelPowers the “clear” command runs when executing a program in Netbeans IDE automatically, so is it possible that system variables might have been changed for some reason which is stopping my program execution inside the IDE? – iamnexxed Oct 25 '18 at 03:09
  • The built in terminal for Netbeans will clear when you execute your application, but as far as I'm aware it's directly clearing its own buffer, not calling an external application to do it. The exception you posted seems to indicate you're trying to call `clear.exe` which isn't being found on your system path. Can you find this executable on your system anywhere? – Michael Powers Oct 25 '18 at 03:17
  • Thank you so much. I understood what you meant. The “clear” command is not meant for netbeans but for the terminal. – iamnexxed Oct 26 '18 at 03:10

0 Answers0