• Post Reply Bookmark Topic Watch Topic
  • New Topic

java -version into a servlet not work  RSS feed

 
Filippe Spolti
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys.

I'm trying execute the java -version command from an web browser, but no success.
Running into eclipse with main class I managed to make it work, i don't know why but he output of this command is returned to ErrorStream, all others linux commands works well, so i did this:



Now, my question is: Why its doens't work into a web broswer?

Thanks.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does "from a web browser" mean - is this an applet? If so, applets are not usually allowed to use Runtime.exec.
 
Filippe Spolti
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a servlet that calls the class ExecuteCommand and prints the result in the browser.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so it's not from a web browser, but from within a servlet container. Why are you trying to do this? The Java version is available in a system property.
 
Filippe Spolti
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to help a friend, so when I saw that the command did not return anything I was very curious and wanted to know why.


Problem solved, thanks.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!