Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Export jar file, convert to exe file (main startup class could not be found)

  1. #1
    Junior Member
    Join Date
    Aug 2014
    Thanked 0 Times in 0 Posts

    Default Export jar file, convert to exe file (main startup class could not be found)

    Hey guys,

    I've been trying to convert a java executable (.jar) to a .NET executable (.exe) and the reason I'm here is because I succeeded... Nope, I wish..

    My code:

    public class Main {
    	public static void main(String[] args) {
                  System.out.println("Hello, world!");

    Easy enough right.. So when I export it into a JAR file called HelloWorld.jar and run it in a command prompt (java -jar HelloWorld.jar), it returns "Hello, world!", which is good.

    Then I convert the .jar file into a .exe file using jar2exe. The exe file comes out and BOOM, when I run it I get an error saying "The main startup class can not be found".

    Also, when I try to use a different program to convert my .jar into a .exe (IKVM), I get the same error, only this time during the conversion which results in nothing.

    Any ideas?

    PS. I know this is not technically a Java IDE issue, but I couldn't find any better place
    Last edited by stevenh; August 19th, 2014 at 08:51 AM.

  2. #2
    Super Moderator
    Join Date
    Jun 2013
    So. Maryland, USA
    My Mood
    Thanked 698 Times in 680 Posts

    Default Re: Export jar file, convert to exe file (main startup class could not be found)

    Welcome to the Forum! Please read this topic to learn how to post code correctly and other useful tips for newcomers.

Similar Threads

  1. Export jar file with emulator
    By youssef77 in forum Java ME (Mobile Edition)
    Replies: 1
    Last Post: August 2nd, 2014, 08:15 AM
  2. How to convert m.file to exe.file in Matlab 12
    By Mumpy Zinu in forum JavaServer Pages: JSP & JSTL
    Replies: 1
    Last Post: February 25th, 2014, 05:41 AM
  3. I cant export my applet into a runnable jar file
    By Shef012 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: February 7th, 2013, 02:08 PM
  4. Execution of .jar file: Could not find main class....Error'
    By suyog53 in forum What's Wrong With My Code?
    Replies: 0
    Last Post: October 14th, 2012, 02:04 PM
  5. Need help to export .jar file
    By piulitza in forum AWT / Java Swing
    Replies: 4
    Last Post: June 8th, 2012, 11:34 AM