Write a java program that contains a shell script which will point to the local directory (current working directory ) and a create a folder there.
When I run the java program using the IDE, it should create a folder in my current working directory,,,
but again the java code must have the shell script to do this task..
Re: Write a java program that contains a shell script
Originally Posted by jemvision
yea.. it says it cant recognise /bin/ksh .
its obvious because I cant execute a shell command from windows...
If you are running your program in Windows you need to use cmd for the shell instead of ksh. You also need to pass /C as an option to cmd so it runs the command (ie your shell script) and terminates, otherwise it will keep running, waiting for more commands (as when you open a DOS window).
Originally Posted by jemvision
could someone please post in a complete working program...
Nope, that's your homework for you to do. It was given to you so you can practice what you have been taught. If we give you a complete working program it would be like cheating and you would learn nothing. We can help you through any issues you may found, but it's going to be better for you to do your homework yourself.
Bookmarks