Want to create animation dll for Window XP Is it ok to create Java2d animation and export as dll??
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
There are "bridges" that allow Java and non-Java code to call into one another. Depending on what you are trying to accomplish, these might be useful as you could write your Java code and then call into it from a C++ or C# DLL, depending on which language you are creating your DLL with, which will also determine what kind of bridge you need. I have never seen a freely provided bridge though. All the ones I've found when looking had to be purchased.
Yes. You need to write code in C++ to start the JVM with the invocation interface to JNI, and call into it. However, you may find it difficult to create windows in this way that integrate seamlessly with your Windows environment application to display your animation. This is a rather advanced JNI usage, and I'd recommend reading the JNI book before even trying a little bit of it.
No, IIRC you can't. DLLs are linked directly when loaded. Java code needs a jvm, so you can only provide a dll that starts a jvm and starts code there, but not all necessarily stuff fits in the dll.
You should not do this. It looks like you're trying to use the wrong approach for your problem.
Well…
It might be possible to put that together to build DLLs using GCJ.
I am pretty sure you can only create .Jar files from java not dlls
Actually, what Quentin said should work.
When you compile java to native with
GCJ
you first compile the.java
files into platform specific.o
(object) files. Presumably you would compile the.o
files into adll
rather than anexe
.GCJ
also includes components like the garbage collector, and base java libraries. None of which require aJVM
to run. The downer is that thedll
would be huge. A simple "Hello World" app when compiled withGCJ
is~35MB
, thanks to all the default libs and the garbage collector. Likewise yourdll
would be huge.