Selim Özdem
Selim Özdem

Reputation: 21

Using jar in asp.net project

I have a problem I want to use jar in asp.net project.

My code:

        System.Diagnostics.Process process1 = new System.Diagnostics.Process();

        process1.StartInfo.WorkingDirectory = Request.MapPath("/");

        process1.StartInfo.FileName = Request.MapPath("kokBul.jar");

        process1.Start();

Error:

a java exception has occurred

please help

Thanks..

Upvotes: 1

Views: 4652

Answers (3)

Selim Özdem
Selim Özdem

Reputation: 21

ok.

I solved the problem of.

I forgot to add the jar libraries used in

My Code:

    System.Diagnostics.Process process1 = new System.Diagnostics.Process();

    process1.StartInfo.WorkingDirectory = Request.MapPath("/");

    process1.StartInfo.FileName = Request.MapPath("kokBul.jar");

    process1.Start();

Upvotes: 1

06needhamt
06needhamt

Reputation: 1605

Error:

a java exception has occurred

indicates there is an error in the JAR file try opening the jar outside the project if it opens outside the project there must be an error in the way it is called

Edit 1 This article may help you Execute jar in asp.net

Edit 2 try deleting the Class-path: line out of the Meta-inf MANIFEST.MF file and try again and if that doesn't work delete the entire meta-inf file

Hope this helps

Upvotes: 2

Nathan
Nathan

Reputation: 2775

You can't use a JAR file directly in .Net.

It must be converted into a DLL, for which you can use IKVM.NET.

You can run:

run ikvmc -target:library mylib.jar

to create mylib.dll.

IKVM: Use Java libraries in your .Net apps

Upvotes: 0

Related Questions