• Post Reply Bookmark Topic Watch Topic
  • New Topic

Run Linux Command from Java  RSS feed

 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,


I am trying to execute Linux Command from Java , when Executing it from terminal it works fine , but when Executing it from Java it does not work

the Command is : "gunzip -c /home/ahmed/SupplierFiles/PRICING_TC.txt.Z > /home/ahmed/SupplierFiles/ZFiles/test.txt"

My Code :

 
Tim Moores
Saloon Keeper
Posts: 4032
94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure you follow every bit of advice found in this article, including using absolute paths.
 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
Tim Moores


I solved it by adding that Command in sh file and then executing it from java with the same way.

I have another Question:

How can i get orginal file Extension from Compressed file?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!