This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Posted by Allan Cahill on April 24, 2000 at 10:43 AM
> > I am trying to find out how to clear an msdos screen using java
> > In c++, there was a function called clrscr() which used to serve
> > this purpose - java does not seem to have anything similiar.
> > I have looked everywhere for a solution, and tried many different
> > suggestions none of which work.
> If you are not concerned about platform independence, which
> your question seems to imply (since you are talking about
> MS-DOS boxes), why not just call a native method that does
> your trusty old C++ clrscr()? To figure out how to do this,
> look for documentation at java.sun.com on JNI. I don't have
> anything significant about JNI here at artima.com, so I'd just
> do a search at java.sun.com for JNI (Java Native Interface).
Ok....i did some research on this, it seems straight forward enough.
I have written the c++ file I want to encorporate -
basically all it does is call the clear screen function clrscr().
However, I was following the instructions to create a shared
library and this is where i seem to be having some trouble.
The code suggested to do so is as follows (For Windows)
cl -Ic:\java\include -Ic:\java\include\win32
-LD HelloWorldImp.c -Fehello.dll
That's fine - i updated this to point to where the include
directory is on my PC.
However, when I run this I get the following
fatal error C1083: Cannot open include file: 'stdio.h':
No such file or directory
Although stdio.h does exist - the thing is I do not call/use
this header file!.
Any help would be gratefully received
- stdio.h vicky March 02, 2001 at 4:19 PM
- stdio Matt Gerrans November 20, 2001 at 1:02 PM