0

I made a project a while ago and compiled to an executable JAR file. Now I'm using JarSplice to wrap it in native executables. How to I specify that the main class is in my JAR? The only instructions are to tell it the package path to the main class, but it seems like that assumes you are using JarSplice with an unbuilt project.

  1. I added my executable JAR.
  2. The JAR's internal path to the main class is "tproxy.gui.Interface".
  3. Should the class path be something like "JarName/tproxy.gui.Interface"?

EDIT: I need to wrap the JAR in an .app executable for OS X, so Launch4j isn't an option.

Sam Claus
  • 1,807
  • 23
  • 39

1 Answers1

0

Just enter the classpath ( eg. "tproxy.gui.Interface" ) there is no need for JarName/ in front of it. It doesn't assume you are using JarSplice with an unbuilt project. It does assume you do not have the same path in two jars. If you used reasonable unique package names that should not be a problem.

WillShackleford
  • 6,918
  • 2
  • 17
  • 33
  • That's what I did but the resulting .app file didn't properly launch the application, even though the executable JAR works just fine. – Sam Claus Oct 16 '15 at 00:22
  • What makes you think the problem has something to do with setting the main class? – WillShackleford Oct 16 '15 at 01:15
  • Because executing the JAR itself runs the application just fine. Adding the JAR was done using the file manager, so there shouldn't be any typos. That just leaves the actual path to execution. The .app also runs just fine, but immediately closes when it fails to execute the wrapped JAR. – Sam Claus Oct 16 '15 at 02:44
  • 1
    I think you should look for error messages. Setting the main class this way works for me. If the main class were wrong you wouldn't be able to execute the jar by itself either. The app could be setting a property or environment variable, or running in a different directory or many other things that would cause a program to fail. If you can't debug any other way, log some messages to a file to determine exactly which lines of code get executed. – WillShackleford Oct 16 '15 at 03:01
  • Alright. How difficult do you imagine it would be to write some swift code that executes he JAR and just wrap it manually using XCode? – Sam Claus Oct 16 '15 at 03:03