How to call Java methods from C program? I.e. is it possible to embed java (not necessary Sun/Oracle JVM) in other language?
- 
        This artcle:javaworld.com/javaworld/jw-05-2001/jw-0511-legacy.html seems to talk about that.Roman A. Taycher– Roman A. Taycher2011-07-02 10:19:36 +00:00Commented Jul 2, 2011 at 10:19
- 
        How to Call Java Functions from C Using JNISaurabh Gokhale– Saurabh Gokhale2011-07-02 10:41:26 +00:00Commented Jul 2, 2011 at 10:41
                    
                        Add a comment
                    
                 | 
            
                
            
        
         
    1 Answer
A full Oracle JVM is a very large chunk to pull into your existing program, but it is perfectly doable but I would recommend against it if any of the following apply:
- You need to pull a lot of data in and out of the JVM on a frequent basis. This is expensive.
- You are not in full control of the operating system and JVM to use.
- You are not an experienced C programmer. Debugging these things can be hard.
You might find jamvm - http://jamvm.sourceforge.net/ - an interesting alternative. It is a very small interpreter written in C, which may be a lot easier to handle. I have not tried embedding it.
