Linking Java programs with Jbase

  • Reham
  • Topic Author
  • Visitor
  • Visitor
19 years 5 months ago #1735 by Reham
Linking Java programs with Jbase was created by Reham
Can we call java functions from Jbase. Is that possible to link java with Jbase? Can anyone suggest me? Thanks in Advance
_________________
Regards,
Sulthana

Please Log in or Create an account to join the conversation.

More
19 years 5 months ago #1736 by mks
Replied by mks on topic Re: Linking Java programs with Jbase
Hello Sulthana,

I guess u r searching 4

www.jbase.com/knowledgebase/manuals/3.0/...s/man/jbc2_CALLJ.htm

Rgds

Please Log in or Create an account to join the conversation.

More
19 years 5 months ago #1737 by malai
Replied by malai on topic Linking Java programs with Jbase
Its Quite intresting.

Let you know about this soon.
_________________
M A L A I

Please Log in or Create an account to join the conversation.

More
19 years 5 months ago #1738 by malai
Replied by malai on topic Linking Java programs with Jbase
After a hard try I got it.

Here it goes.

Before stating this you should install jdk1.4 or jre in your machine. I tried in my windows machine with XP with jdk1.4.

This is the java program

File . , Record 'TestJava.java'
Command->
001 public class TestJava {
002 public String testMethod(String str){
003 return 'Java inSide jBASE '+str;
004 }
005 }

Compile this program using javac and create the .class file.

This is the jBASE program

File . , Record 'CALL.JAVA.b'
Command->
001 PROGRAM CALL.JAVA.b
002 CALLJ 'TestJava','testMethod', 'We Are Great' SETTING ret ON ERROR
003 PRINT 'ERROR'
004 STOP
005 END
006 CRT ret
007 STOP

To link this java program inside jBASE we need to set JBCJVMLIB to the patch where jvm.dll is present.

In my machine it is present under C:j2sdk1.4.1_07jreinclient

So, In the jBASE prompt set this variable.
set JBCJVMLIB=C:j2sdk1.4.1_07jreinclientjvm.dll

Compile the jBASE program using jbc/jcompile

jsh -->jbc CALL.JAVA.b -o CALL.JAVA.out

Now execute CALL.JAVA.out in the jBASE prompt.

jsh -->CALL.JAVA.out
Java inSide jBASE We Are Great

Thats all. Let me know if you need further info.
_________________
M A L A I

Please Log in or Create an account to join the conversation.

  • Reham
  • Topic Author
  • Visitor
  • Visitor
19 years 5 months ago #1739 by Reham
Replied by Reham on topic Thanks Malai & Mruthyu Sir
Thanks malai n mruthyu sir.
You have done a very Good Job. Thank you very much for ur detailed output malai.
_________________
Regards,
Sulthana

Please Log in or Create an account to join the conversation.

More
19 years 5 months ago #1740 by malai
Replied by malai on topic Linking Java programs with Jbase
Hi sul,

mks is manoj kumar sharma not mruthyu.


_________________
M A L A I

Please Log in or Create an account to join the conversation.

Time to create page: 0.045 seconds