aspose file tools*
The moose likes Beginning Java and the fly likes compiling c/c++ derived object files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "compiling c/c++ derived object files" Watch "compiling c/c++ derived object files" New topic
Author

compiling c/c++ derived object files

Vasant Manohar
Greenhorn

Joined: Jun 11, 2004
Posts: 2
hi all,

i wanted to know if java allows you to compile object files derived from c/c++. if yes, please let me know how to do so.

thanks in advance.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Hi,

Welcome to JavaRanch!

Of course, no compiler allows you to compile object files; object files represent code that's already been compiled. If you're asking whether you can link native object files directly with Java, the answer is no; Java's bytecode is utterly different from native machine code.

If you're asking whether, one way or another, you can call C/C++ functions from Java, on the other hand, the answer is yes, you can -- you can use the Java Native Interface, or JNI.


[Jess in Action][AskingGoodQuestions]
Vasant Manohar
Greenhorn

Joined: Jun 11, 2004
Posts: 2
hi there,

yes, i was asking about linking native object files with java. since its not possible, i shud probably look at JNI as you suggested.

thanks for the prompt reply
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: compiling c/c++ derived object files