none
How to convert .exe into .jar

    Question

  • Hi 

    Hope all you are fine.

    i have an exe that is develop in vs.net. I want to install it in My Mobile. In other sense i want to convert .exe file into .jar file. Because my mobile support .jar file. 

    thanks. 

    Wednesday, June 27, 2012 1:16 AM

Answers

  • Hi,

    first of all I have to tell you that this forum covers Windows Forms only which is a technology of .Net Framework to build desktop applications.

    Then you have to understand that an exe is an executable which is only supported on special platforms. And there is no way to "convert" the executable to .jar.

    I think that your mobile expects a java application packaged inside a .jar file. (.jar files are simply archives. Of course you can put the executable inside a jar file as you can put it into a zip file. But your mobile will not be able to run it at all because it should simply check the jar file to read a manifest which stores information of the java application. Then the class loader is loading the required classes to run the application. And the classes must be there in java bytecode.

    My biggest suggestion is to search on the net for introductions and tutorials on how to write applications for your mobile. I am quite sure that bing or google will help you on that. Maybe you also search for some forums where people might help you on that. And then you write an application for your mobile directly. That is the way to go!

    But I think that it is simply not possible to convert a binary that was created for another platform (Windows Desktops I asume) to a mobile - and even if someone wrote such a tool: It does not make sense at all because a PC is completly different to a mobile regarding display and usage.

    I hope this helped a little bit.

    With kind regards,

    Konrad

    Wednesday, June 27, 2012 2:28 PM

All replies

  • Hi,

    first of all I have to tell you that this forum covers Windows Forms only which is a technology of .Net Framework to build desktop applications.

    Then you have to understand that an exe is an executable which is only supported on special platforms. And there is no way to "convert" the executable to .jar.

    I think that your mobile expects a java application packaged inside a .jar file. (.jar files are simply archives. Of course you can put the executable inside a jar file as you can put it into a zip file. But your mobile will not be able to run it at all because it should simply check the jar file to read a manifest which stores information of the java application. Then the class loader is loading the required classes to run the application. And the classes must be there in java bytecode.

    My biggest suggestion is to search on the net for introductions and tutorials on how to write applications for your mobile. I am quite sure that bing or google will help you on that. Maybe you also search for some forums where people might help you on that. And then you write an application for your mobile directly. That is the way to go!

    But I think that it is simply not possible to convert a binary that was created for another platform (Windows Desktops I asume) to a mobile - and even if someone wrote such a tool: It does not make sense at all because a PC is completly different to a mobile regarding display and usage.

    I hope this helped a little bit.

    With kind regards,

    Konrad

    Wednesday, June 27, 2012 2:28 PM
  • Hi, 

    Konrad Neitzel. Thanks for your interesting and good answer. 

    first of all I have to tell you that this forum covers Windows Forms only which is a technology of .Net Framework to build desktop applications.

    I also want to make desktop Application. i thought that may be its possible to convert .exe to .jar that's why i was ask that Question.

    and i also thought that in vs 2008 click on "New Project" and select "Smart Device" and then select "Pocket PC 2003" or "SmartPhone2003" and create New "Empty Project" solve this problem. If its Possible then i will be very thank full to your help. 

    Thanks

    Thursday, June 28, 2012 5:51 AM
  • I'm agree with Konrad.

    You can't convert a .net application to .jar. A .net application need .Net Framewrok supported while .jar is completely different technology.

    You need to other technology to write a mobile application.

    Best Regards,


    Bob Wu [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, June 28, 2012 8:03 AM
  • Hi,

    you should be aware, that there are a lot of different platforms around and none is fully compatible to the other. So you should specify your target platform. What system do you want to develop for? I am not sure what applications want jar files. Is it Android?

    So you need to be very carefull. The project templates you can select are quite old and I am not sure that you want to target such an old platform. (But the result should be a CAB file that can be installed on these devices. I think that was a common part that I just know from windows mobile 6 which was my starting platform when looking at mobile devices development) The current platform for smartphones from Microsoft is Windows Phone 7. You can develop applications for it using Silverlight and/or XNA Gamestudio. The new platform windows phone 8 is comming soon, too. There are not many details available so far but I expect that you can develop XAML/C# applications that are more or less like Silverlight on WIndows Phone 7. (But that is a guess. I just know the Windows 8 Metro Style App Development and the information from the Windows Phone Summit where Microsoft said that the Winodows 8 Core is also inside Windows Phone 8.)

    And even for these platforms that all come from Microsoft: You do not have one project and get an result that can run on all. Instead you have to create a project for each:
    - WPF project to target Windows Desktop
    - Metro project to target Windows 8 Metro
    - Windows Phone project to create something to run on windows phone.

    Even that it is possible to take over a lot (e.g. C# code and XAML parts) you have to create your own projects. And you will have changes. Users expect a different way to use applications. So some applications must support touch and others should not really be touch optimized. Some should scroll horizontal and some should scroll vertical. The platforms are simply not the same even that Microsoft tried to make them like each other. (So WinRT from Windows 8 is not .Net. And the micro framework is not the full .Net framework and Silverlight is also something seperate.)

    If you really want to create just one application and run it on all devices, then you should look for vendors who offer development environments that can build different applications. They normally provide you their own language, tools and so. When you build the application, it is either translated to their own code (which can run on different platforms through a runtime) or they build a native app for the target platform. But I don't know any of these tools and I doubt that there are free ones. But it could be worth to research this topic. (I do not like this idea. I like to have more control so I can fully support my users. It is always a bad thing to have a tool do things as a black box and you have no change to find out what is going wrong. I just had such a case with LightSwitch which really caused me 1 week full of headaches and stomach pain!)

    With kind regards,

    Konrad

    Thursday, June 28, 2012 11:02 AM
  • Mobile Applications as of today require pure Java coding , Visual Studio has propriety classes and J# code cannot be converted to JAR . Use Eclipse and you will have to code using javax.swing classes and java.awt classes for GUI interface . Java code is stringent and unlike C++ you will not have tangible flexibility . Developing Mobile appliations is painful because Java compiler does not allow you to play with memory and registers so the Java program is safe and will not damage any hardware .

    Visual Studio is the state of art Rapid Application Development tool unfortunately only for developing Windows Mobile Appliations . Most Mobile tehnology only

    allows Jar or cod so you have to code in pure Java without RAD tools like Visual Studio 2008

    Have a nice day .

    Monday, April 08, 2013 4:33 AM