Why I can't run specified command in Code PlayGround ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

Why I can't run specified command in Code PlayGround ?

I have ran "java -version" in Code PlayGround successfully(https://code.sololearn.com/cG7z43ybi1km/#java), but I don't understand why I can't run other command such as "tree" or "dir" ? It will output something like this. java.io.IOException: Cannot run program "tree" (in directory "..\Playground\"): CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(Unknown Source) at Program.run(Program.java:33) 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>(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 2 more

9th Aug 2017, 10:05 AM
Corey
Corey - avatar
1 Answer
+ 3
When you hit the button to run the code, it will be uploaded to a server of sololearn, compiled by the server and ran by the server. The result will be sent back to your phone. Because code could manipulate their servers, they gave your code restricted permissions, so you can't delete important folders or data. As you can see, they also blocked the tree or dir command, so that you can't see all folders and their directions. They did this because of privicy reasons, so that you can't see the whole system of the server and look how things are done.
9th Aug 2017, 11:46 AM
StoneSmasher
StoneSmasher - avatar