• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple program that executes from console and opens another console

 
Sandra Bachan
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,


I would like to create a simple program (no applets, no graphics) that executes from the console to open another console. I have searched the internet and these forums, but cannot find the particular Java 6 API that creates a console, and launches it from an existing console. Please help.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is platform specific, of course, but I'm guessing...

See this page for more details.
 
Campbell Ritchie
Sheriff
Pie
Posts: 50189
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And always read Michael Daconta's classic article which you can find by Googling for Michael Daconta when Runtime.exec() won't, before going anywhere near Runtime.exec().
 
Sandra Bachan
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, my code needs to be compatible to unspecified Operating Systems. Wanted to create program in order to study of SCJP6 Certification Exam. Guess I'll have to use Applets...
 
Campbell Ritchie
Sheriff
Pie
Posts: 50189
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot expect to call an operating system component (the command line, terminal or shell) without knowing its name. You can get the name of the operating system from the SystemgetProperty(java.lang.String) method, and you can create a Map linking operating system names to the commands to open a window, but even that is fraught with difficulty; not all Linux users use "bash" as their shell, for example.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic