Article View: borland.public.jbuilder.java.language
Article #15305Re: How do I call a CBuilder 4.0 DLL from Java
From: Mike Schoonover
Date: Wed, 23 Jun 1999 00:00
Date: Wed, 23 Jun 1999 00:00
66 lines
3229 bytes
3229 bytes
This is a multi-part message in MIME format.
--------------511535F2CA68D562B97F4186
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Thanks for the info. For anyone else trying to use javah in Borland's Java
Builder, please note the following:
Sun's online tutorial regarding the use of javah does not really explain which
directory you should run javah in. The example does not place the class in a
package - this results in the class being placed in the "default" package.
By default Java Builder places all compiled default classes in the directory
\JBuilder2\myclasses
If you specify a package for your class, JBuilder places the compiled class
file in
a subdirectory of myclasses which will have the same name as your package. For
instance, if you have a class called "this_class" in a package called
"this_package", JBuilder will compile the class and place a file called
"this_class.class" in the directory:
\JBuilder2\myclasses\this_package
If you go to the \JBuilder2\myclasses\this_package directory and try to run
javah on "this_class.class" you will get an error. javah assumes that you are
running the program in the "myclasses" directory. It will concatenate the
package with the class name to find the path to the class file - this fails
unless you are in the "myclasses" directory.
To run javah on the above class, go to the \JBuilder2\myclasses directory and
run javah by typing "..\java\bin\javah -jni this_package.this_class
javah will create the path "this_package\this_class.class" and open that file.
Then it will operate on "this_class" which it should find in "this_package".
By default, the resulting .h file will be placed in the "myclasses" directory.
This problem pops up because Borland generally inserts a package statement into
the files it creates, placing your classes in a specified package.
--------------511535F2CA68D562B97F4186
Content-Type: text/x-vcard; charset=us-ascii;
name="mike.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Mike Schoonover
Content-Disposition: attachment;
filename="mike.vcf"
begin:vcard
n:Schoonover;Mike
tel;pager:281-631-1683
tel;fax:713-462-5155
tel;home:281-373-1694
tel;work:713-462-4622
x-mozilla-html:TRUE
url:folsomvillage.com
org:ICO, Inc.;R&D
version:2.1
email;internet:mike@folsomvillage.com
title:Programmer
note:Hello
adr;quoted-printable:;;9400 Bamboo=0D=0A;Houston;TX;77041;USA
fn:Mike Schoonover
end:vcard
--------------511535F2CA68D562B97F4186--
Technical Details
Message-ID:
<3771AFE6.26994CE@folsomvillage.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<376C480C.36F205C4@folsomvillage.com> <376E9B0A.E1613984@nosc.mil>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,ffbce02944f5e6d0 X-Google-Attributes: gidf74b3,public From: Mike Schoonover <mike@folsomvillage.com> Subject: Re: How do I call a CBuilder 4.0 DLL from Java Date: 1999/06/23 Message-ID: <3771AFE6.26994CE@folsomvillage.com> X-Deja-AN: 493219637 References: <376C480C.36F205C4@folsomvillage.com> <376E9B0A.E1613984@nosc.mil> X-Accept-Language: en Content-Type: multipart/mixed; boundary="------------511535F2CA68D562B97F4186" Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language