2

How to call Java methods from C program? I.e. is it possible to embed java (not necessary Sun/Oracle JVM) in other language?

2

1 Answer 1

5

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.