Delphi Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
델파이 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
FreePascal/Lazarus
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
델마당
볼랜드포럼 광고 모집

델파이 Q&A
Delphi Programming Q&A
[15465] 이게 뭔가요? 델파이에서 자바를 쓸 수 있다는 건가요?
첫눈 [hadugo] 2460 읽음    2015-04-10 12:22
[JNI Wrapper for Delphi]라는 건데
http://sourceforge.net/projects/djbridge/files/jniwrapper/
여기서 받았구요.

영어가 짧아 일일히 번역은 못하겠지만 대충 아는 단어들로만 짐작해 보면
델파이에서 자의 JNI를 사용할 수 있다는 이야기인 듯 합니다.



샘플예제가 몇개 있긴 하지만 컴파일 해보면 에러가 나는데
영어도 짧은데다가 델파이까지 짧아 어디를 수정해야 할지 몰라 테스트도 못해봤습니다.

JavaRuntime.pas에서

const
  PLUGIN_11_KEY = '\SOFTWARE\JavaSoft\Java Plug-in\1.1';//Home
  IBM_JRE_11_KEY = '\SOFTWARE\IBM\IBM WIN32 Runtime Environment, Java(TM) Edition';
  IBM_JDK_117_KEY = '\SOFTWARE\IBM\IBM WIN32 Developer Kit, Java(TM) Edition\1.1.7';
  IBM_JDK_118_KEY = '\SOFTWARE\IBM\IBM WIN32 Developer Kit, Java(TM) Tech. Edition\1.1.8';
  JRE_11_KEY = '\SOFTWARE\JavaSoft\Java Runtime Environment\1.1'; //JavaHome, Microversion
  JB_KEY = '\SOFTWARE\JavaSoft\Java Runtime\1.1.6'; //JavaHome
  JDK_11_KEY = '\SOFTWARE\JavaSoft\Java Development Kit\1.1'; //JavaHome, Microversion
  JRE_12_KEY = '\SOFTWARE\JavaSoft\Java Runtime Environment\1.2'; // JavaHome, RuntimeLib
  JRE_13_KEY='\SOFTWARE\JavaSoft\Java Runtime Environment\1.3';
  JRE_14_KEY='\SOFTWARE\JavaSoft\Java Runtime Environment\1.4';
  PLUGIN_12_KEY = '\SOFTWARE\JavaSoft\Java Plug-in\1.2'; // JavaHome, RuntimeLib
  PLUGIN_13_KEY = '\SOFTWARE\JavaSoft\Java Plug-in\1.3'; // JavaHome, RuntimeLib
  PLUGIN_14_KEY = '\SOFTWARE\JavaSoft\Java Plug-in\1.4';
  JDK_12_KEY = '\SOFTWARE\JavaSoft\Java Development Kit\1.2'; //JavaHome, Microversion
  JDK_13_KEY = '\SOFTWARE\JavaSoft\Java Development Kit\1.3';
  JDK_14_KEY = '\SOFTWARE\JavaSoft\Java Development Kit\1.4';

  JRE11Keys : array[1..3] of String = (PLUGIN_11_KEY, IBM_JRE_11_KEY, JRE_11_KEY);
  JDK11Keys : array[1..4] of String = (IBM_JDK_118_KEY, IBM_JDK_117_KEY, JDK_11_KEY, JB_KEY);
  JRE12Keys : array[1..6] of String = (JRE_13_KEY, PLUGIN_13_KEY, JRE_12_KEY, PLUGIN_12_KEY, JRE_14_KEY, PLUGIN_14_KEY);

이 부분을 수정하면 될 것 같기도 하고....


고수님들께서 확인해 보시고 에러 수정과 자세한 설명까지 해 주시면 감사하겠습니다.



.....
.....

•TJavaRuntime is an encapsulation of the JNI Invocation API. In most cases, you will get an instance of this class by calling the class method GetDefault.

•TJavaParams is an encapsulation of the list of parameters passed to a Java method.

•TJavaObject is an encapsulation of a Java object.

•TJavaClass is an encapsulation of a Java class.

•TJavaMethod is an encapsulation of a Java method.

...........
..........



Contents of archive:
• JNI.pas -- translation of the jni.h file in the Sun JDK to Pascal.


• JNIWrapper.pas -- delphi source code containing object pascal class wrappers for JNI handles.


•JavaRuntime.pas -- delphi source code containing object pascal class TJavaRuntime that provides an easy-to-use wrapper around the JNI invocation API.


• JUtils.pas -- Source of various routines used here and there.


• JTest*.dpr -- These files contain delphi source of demos that show how to use the JNIWrapper.pas code in your programs.


• HelloWorld.java -- the source to a Java program that is used in JTest demos.


• native.dpr -- Source for a trivial DLL written in Delphi to demonstrate a native call to delphi from Java. The Java part of this demo is in the file NativeExample.java


• Bothways.dpr -- This provides an example in which Delphi code calls Java code and then viceversa!


• build.bat -- A command-line batch file which compiles all the included source files. It is assumed that you have the Delphi command line compiler DCC32.exe and the default Java command-line compiler javac.exe on your system path. Note: This code compiles with Delphi 4. I haven't tried it with any later version. Please tell me if there is a problem.






+ -

관련 글 리스트
15465 이게 뭔가요? 델파이에서 자바를 쓸 수 있다는 건가요? 첫눈 2460 2015/04/10
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.