Embedding a Jar into a C# Form - c#

Ok this situation is a bit difficult. But I am trying to embed a Java Jar into a C# form. Not as a new window or new process.
The Jar will be a game that uses the LWJGL library.
The C# Form will be a "wrapper" for it with tools and more.
Anyone have any ideas? Is this even possible?

According to the IKVM Home Page
IKVM.NET is an implementation of Java
for Mono and the Microsoft .NET
Framework. It includes the following
components:
A Java Virtual Machine implemented in
.NET A .NET implementation of the Java
class libraries Tools that enable Java
and .NET interoperability

One would approach it from using a DLL not a jar. Also this sounds like a bit of a security issue.

They're completely different runtimes; you'll need a process for both the CLR and the JVM; no way around that.
You can try the Java to C# converter provided by MS, and then rebuild: http://www.microsoft.com/downloads/details.aspx?FamilyID=46bea47e-d47f-4349-9b4f-904b0a973174&displaylang=en

Related

Use of Java code in other platforms using Mono

I am working on a project which is written in Java (6.0) and I want to use it in almost all the platforms (iOS/Android/Windows/Windows Phone/Mac/Linux) so I thought of Mono and converting the code to C# but it's 40,000 line of code so it would take so much time to write that. Then I realized that I can use JavaBinding to convert a lot of it and use it but I am not sure if I can use it in Windows or more important iOS.
So basically my question is that "Does java binding converts Java code to C# or it's just a call to the java code? If so, I can't use it for my MonoTouch project"
Two approaches are possible,
Use Sharpen to convert Java code to C# code. A perfect example, is to port Android to C# http://blog.xamarin.com/android-in-c-sharp/
Use IKVM to host Java code on Mono. http://www.ikvm.net/
JavaBinding is only useful for Mono for Android, and I don't think it applies to Windows/iOS.

Can ImageMagickNET be used with c#?

I am making an application for editing images. I tried using ImageMagickNET, but can't figure out how to use the API - or if it even works with C#.
Does anybody know ho to use this API or if it works with c#?
ImageMagick.NET appears to be a managed C++ wrapper around the ImageMagick API. As such it should be usable by any .NET language (VB.NET, C#, even IronPython). I don't have experience using it at all but based on what I see in the code in their CodePlex repo I don't see any reason it wouldn't work.

how use java applet in asp.net without installing java runtime?

i am new in java applet ...
where can i learn more about java applet (related to asp.net) and is it possible to use java applet in asp.net without installing java run time ?
mean is there a library for java on the net that we can refer it ?
(how ?)
for example how can i use below java applet codes without forcing my users to install some thing on their machines?
How to find client computer name in java script/jsp?
mean JĂșlio Santos answer
thanks in advance
The example you mentioned uses ActiveX (built into IE) and JScript (also built into IE). You do not need the Java Virtual Machine to be installed for that.
In general, running a Java Applet in ASP.NET does not make sense because Applets are client side (they run in the browser) while ASP.NET is (mainly) server side. You can use IKVM to compile the Applet into something .NET understands but that basically gives you access to its public methods which may or may not help depending on your use case.
Here's how you can have IE auto install the JVM runtime: http://java.sun.com/developer/technicalArticles/JavaLP/javawebstart/AutoInstall.html
You cannot use Java without having the runtime installed.
The easiest way to do so, is to let the user navigate to java.com.

Can you embed Python into a C program and then call it from C#/ASP.NET with no outside tools?

I got a question about embedding Python into C/C++ programs. I'm new to .NET and C sharp, and
I was recently able to call a few dlls (one simple hello world C I made from scratch with the help of Vladimir Tskhvaradze's 05 how to, and a user.32 out of the 70-536 book).
I see in my Python documentation 2.6 that I can embed Python into C/C++.
Is it possible to then call this newly created C program("module"?) with the Python embedded (code and Im assuming interpreter) from ASP.NET/C sharp and have it all coexist peacefully in .NET?
I see different tools etc...but I wanna know straight out the box can I do this. Also how much would using Visual Studio C++ 08 or 10 help/hinder this process?
I recommend to use COM: write a COM server in Python (using win32com), and then access it from C# (using .NET's COM interop). You should start with a hello-world style application, to make sure it can work at all. This should not require any additional tools, and no C code.

zxing in C# using IKVM

I converted the jar file into .net dll file using IKVM. Now i am trying to consume it in my .net app, but it seems that the qrcodereader.decode requires BinaryBitmap which further requires Luminance as parameter. Please guide me in this situation since i couldn't find the right classes that implements the abstract classes.
Luminance sources are platform specific. You can find examples in the android, java2se, and iphone directories. I don't know if there are any luminance sources in the csharp directory but that code is not actively maintained so even if there is, it'll likely take cleanup adaptation (not to mention I have no idea if it's compatible with IKVM).

Categories