Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Sienna Hughes   on Feb 17 In Java Category.

  
Question Answered By: Aaron Evans   on Feb 17

no, you can't link object  files with java  classes. The reason is
simply that object files  are _meant_ for being linked whereas Java
classes are meant to be interpreted by the Java interpreter; a .class
file doesn't contain any machine code.

What you could try is one of the following:

1) from C/C++ you only can invoke a Java class using the system()
call or one of the exec() functions; there you would have to execute
something like
sprintf( Cmd_String, "java %s", Path_To_Java_Class);
system( Cmd_String);

2) From Java you could take a look at the System or Runtime classes,
in particular at the loadLibrary() function and relatives. I haven't
understood what they are meant for when browsing through the Javadoc,
but I hope you can make use of this info.

Share: 

 
 
Didn't find what you were looking for? Find more on linking c/c++ object files Or get search suggestion and latest updates.


Tagged: