in the past i have been able to run dos commands thru C++... for example: system("cls") in C++ used to clear the screen... does anyone know if this can be done in java?

Recommended Answers

All 3 Replies

Well, since Java doesn't run on DOS but only on 32 bit operating systems you won't be able to execute DOS commands.

You can however (if you insist on loosing platform independence) execute Windows (or Unix) shell commands using the appropriate methods from the Runtime class.
As I in principle don't agree with doing this you'll have to figure out the rest on your own, there's tons of documentation about the pitfalls.

thanx for the information... makes sense

You can download DOS versions such as Koffee I think it's called, but I don't see a point in that, and I doubt it would change much accessibility.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.