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 vicky on March 02, 2001 at 4:19 PM
> > > 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
Hey allan>>> according to your message above...u mentioned that you do not include the stdio.h file...thats write.
what actually happens is that the jni.h file under include/win32 tries to include that file.
even i was facing the same problems but when i copied the stdio.h file under include/win32...i got my dll created.
but i made my dll on a solaris machine...on NT eveni got some errors.
any comments on the above will help me 2 pal.
- stdio Matt Gerrans November 20, 2001 at 1:02 PM