SampleForJava
所属分类:Java编程
开发工具:Windows_Unix
文件大小:158KB
下载次数:45
上传日期:2007-07-04 12:17:08
上 传 者:
phoenix.xia
说明: 学习JAVA编程的示例,包括多版本代码编写,I18n支持等
(learning Java programming examples, including multiple versions of code development, support Discuss)
文件列表:
SampleForJava\run.bat (165, 2003-01-09)
SampleForJava\i18nDemo.jpx (3014, 2003-01-21)
SampleForJava\i18nDemo.jpx.local (2229, 2003-01-28)
SampleForJava\i18nDemo.jpx.local~ (1811, 2003-01-09)
SampleForJava\i18nDemo.jpx.temp (1857, 2003-01-21)
SampleForJava\i18nDemo.jpx~ (2908, 2003-01-09)
SampleForJava\makejar.bat (46, 2003-01-09)
SampleForJava\manifest (43, 2003-01-09)
SampleForJava\bak\Res_en_US.java~1~ (631, 2003-01-08)
SampleForJava\bak\i18nDemo.java~1~ (1697, 2003-01-09)
SampleForJava\bak\Res_en_US.java~2~ (627, 2003-01-09)
SampleForJava\bak\Res_zh_CN.java~1~ (625, 2003-01-09)
SampleForJava\bak\i18nDemo\Res_zh_CN.java~1~ (627, 2003-01-09)
SampleForJava\bak\i18nDemo\Res_en_US.java~1~ (629, 2003-01-09)
SampleForJava\bak\i18nDemo\Res.java~1~ (265, 2003-01-09)
SampleForJava\bak\i18nDemo\Res_zh_CN.java~2~ (625, 2003-01-09)
SampleForJava\bak\i18nDemo\Res_en_US.java~2~ (627, 2003-01-09)
SampleForJava\bak\i18nDemo\i18nDemo.java~6~ (1832, 2003-01-09)
SampleForJava\bak\i18nDemo\i18nDemo.java~7~ (1966, 2003-01-09)
SampleForJava\bak\i18nDemo\Res.java~2~ (64, 2003-01-09)
SampleForJava\bak\i18nDemo\Res_zh_CN.java~3~ (639, 2003-01-09)
SampleForJava\bak\i18nDemo\Res_en_US.java~3~ (641, 2003-01-09)
SampleForJava\bak\i18nDemo\i18nDemo.java~8~ (1964, 2003-01-09)
SampleForJava\bak\i18nDemo\i18nDemo.java~9~ (1966, 2003-01-09)
SampleForJava\bak\i18nDemo\i18nDemo.java~10~ (1966, 2003-01-09)
SampleForJava\bak\i18nDemo\i18nDemo.java~11~ (1972, 2003-01-09)
SampleForJava\bak\i18nDemo\i18nDemo.java~12~ (1966, 2003-01-09)
SampleForJava\bak\i18nDemo\Res_zh_CN.java~4~ (624, 2003-01-09)
SampleForJava\bak\i18nDemo\Res_en_US.java~4~ (626, 2003-01-09)
SampleForJava\bak\i18nDemo\Res_zh_CN.java~5~ (626, 2003-01-09)
SampleForJava\bak\i18nDemo\Res_en_US.java~5~ (628, 2003-01-09)
SampleForJava\bak\i18nDemo\i18nDemo.java~13~ (1968, 2003-01-09)
SampleForJava\bak\i18nDemo\Res_zh_CN.java~6~ (623, 2003-01-09)
SampleForJava\bak\i18nDemo\i18nDemo.java~14~ (1966, 2003-01-09)
SampleForJava\bak\i18nDemo\i18nDemo.java~15~ (1966, 2003-01-09)
SampleForJava\bak\i18nDemo\Res_zh_CN.java~7~ (621, 2003-01-09)
SampleForJava\bak\i18nDemo\Res_en_US.java~6~ (626, 2003-01-09)
SampleForJava\bak\i18nDemo\FtpDownLoad.java~8~ (1364, 2003-01-21)
SampleForJava\bak\i18nDemo\FtpDownLoad.java~9~ (1367, 2003-01-21)
SampleForJava\bak\i18nDemo\FtpDownLoad.java~10~ (1383, 2003-01-21)
... ...
README
Shared Stubs JNI Example
-----------------------------------------------------------------------
This directory contains an example demonstrating the use of shared
stubs for calling native code from Java(tm) applications. For
instance, we show how you could call the function printf from the
standard C library with little work.
A shared stub is a single JNI native method that can dispatch to many
C functions that reside in some shared library (also known as
dynamically linked libraries). This is the sample code of a
JavaOne'*** presentation. The presentation was titled "Java(tm) Native
Interface Technology Programming," and slides from the presentation
can be viewed by following links from
http://java.sun.com/javaone/index.html
For more information about shared stubs, we encourage you to read the
source code in this directory; this is an annotated example! Start
with the file Main.java.
At the time of this writing, we have implemented shared stubs for
SPARC based Solaris(tm) and 32 bit Windows(tm) platforms.
----------------------------------------------------------------------
Contents
----------------------------------------------------------------------
We give a short description of the contents of this directory. If you
are learning this example, and how it works, it might help to browse
the files in the order listed here.
Main.java Entry point to this example. Shows how you
would call C functions such as printf, scanf,
etc.
makefile.unix Makefiles for compiling and running this
nmakefile example on Solaris and Windows.
CFunc.java An abstraction for a C funtion. Users will
create an instance of class CFunc, and then do
a "callXXX" operation on that instance to cause
the real C function to be called.
CPtr.java An abstraction for a C pointer that points to
an arbitrary C type. Think of an instance of
CPtr as a something that represents a
"void *". CPtr provides methods that let you
indirect the "void *" and get at what is
pointed at as a Java data type.
CMalloc.java Just a CPtr, but the CPtr represents a C
pointer that has been malloc'ed on the C heap.
Use this if you have to pass malloc()'ed
memory to some CFunc.
dispatch.c Implementation of the shared stub native methods.
dispatch_sparc.s SPARC specific parts of dispatch.c.
dispatch_x86.c Win32/x86 specific parts of dispatch.c.
----------------------------------------------------------------------
Requirements
----------------------------------------------------------------------
To build and run this example you will need one of the following
operating systems:
- SPARC based Solaris 2.4 (or higher)
- Windows NT 4.0
- Windows 95
You will have to install JDK(tm) software, release 1.1 or higher.
On Solaris you will need a C compiler (cc or gcc), and tools "as",
"ld" and "make", available in /usr/ccs/bin. On Windows, you will need
the utilities "nmake" and "cl" from the Microsoft Developer Studio
suite of products; however, it should be trivial to create a makefile
to run this example with other C compilers.
----------------------------------------------------------------------
Compiling and running
----------------------------------------------------------------------
On Solaris, if you have JDK software installed in /home/user/jdk,
type:
% make -f makefile.unix JDK=/home/user/jdk
On Win32, if you have JDK software installed in c:\jdk, type:
C:\JNI_Example> nmake -f nmakefile JDK=c:\jdk
The default target runs the example, in addition to compiling it.
If you wish to only compile the example, specify the target "build"
explicitly at the make command line.
----------------------------------------------------------------------
Comments and feedback
----------------------------------------------------------------------
Please send comments about this example, and JNI in general, to the
alias "jni@java.sun.com". We welcome your feedback! Folks on this
alias are developers, and will not be able to provide support, but
will read comments.
For support, please visit the Java(tm) Developer Connection at:
http://java.sun.com/jdc
If you find any bugs in this example, please send email to the JNI
alias. Please file JNI bug reports at:
http://java.sun.com/cgi-bin/bugreport.cgi
近期下载者:
相关文件:
收藏者: