Just started learning Java...

Started by
22 comments, last by Kambiz 17 years, 11 months ago
Quote:Original post by Kambiz
I know *exactly* what I want:
My application will have a small kernel, the kernel will load many PlugIns, compile them and use them when needed. In Managed C++ or C# I would use C# like a scripting language and compile all the PlugIns using the CodeDomProvider, now I want to know if it is possible to do the same thing in Java.
Please do not tell me I need to use a scripting language! If that is the only way in Java I will use c# for this Project at the cost of portability.


Wow! Microkernels!

OSGI has been doing this for the last six years, and some big projects use it. http://www.osgi.org/ , http://download.eclipse.org/eclipse/equinox/

For the scripting stuff use either the framework at Apache or Java 6 that has the scripting engine bundled.

For compiler stuff use the compiler API in Java 6.

Good luck.
Advertisement
Quote:Does this mean that an implementation of CodeDom only exists if you have a .Net SDK installed? Or idoes the SDK come with the runtime?

You can use the c# and jscript.net compilers directly in your application. They are integrate in the .Net framework and the user does not need to install the SDK. You can even compile the code to an assembly in memory and then use it.
I have used c# and jscript.net as scripting languages in some of my c# programs, having such a compatible scripting language makes everything easy and such compiled scripts run as fast as your code.
Quote:Original post by jfclavette
I've written my whole game server in C++. I want to write the client in Java while reusing the common classes I need. Isn't that valid ?


You would need to use JNI for interfacing with C++, which is not good because the VM don't have a clue of what you are doing with the memory.

JNI should be used only for legacy stuff.

Not sure what would be the best way in this case.

Quote:Original post by jfclavette

There's the Java 6 Mustang scripting language support. Prior to that there was a framework for adding such languages to Java at Apache website that's not locked to a specific language.


I wasn't aware of that. Why is it so underused compared to similar .NET functionnality ?

The Java 6 feature is fairly new. There are tens of languages ported to the JVM but only now it's going to be official part of the JDK to support them.

I think the reason for people not to talk about it too loud is that they don't trust such languages too much and prefer to use Java.
Thanks...!!
I found what I need:
http://www.javalobby.org/java/forums/t44534.html

This topic is closed to new replies.

Advertisement