1

I've made Tic Tac Toe in Java and I've got two Jar files.

I want to put them both into one exe.

Is it even possible, or do I have to convert only Main file and another one another way?

I've never done this before.

Need suggestions for the implementation.

sliziky
  • 129
  • 2
  • 3
  • 10

1 Answers1

1

To make an exe file you need to define one jar as a point of execution. That jar must contain a main() method. If you have two jars and all contain main method, then you can call First's jar's main method in Second's main method and declare the Second jar as the point of execution.

Like this:

class First {
    public static void main(String[] arg) {
        //excution code
    }
}

class Second {
    public static void main(String[] arg) {
        First.main(arg);
    }
}

I hope this will help.

Tom
  • 16,842
  • 17
  • 45
  • 54
Rabia Naz khan
  • 507
  • 4
  • 13