Tech Off Thread

3 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Launching a SWT app in windows

Back to Forum: Tech Off
  • User profile image
    bart7simpso​n7

    I am doing a SWT application and for launching it I have a .bat with the following command:

    java -classpath "%CD%\org.eclipse.swt.win32.win32.x86_3.2.1.v3235.jar;%CD%" -Djava.library.path="%CD%" mypackage.Main

    The problem is that the console window is still there and if I close it. the app is also closing.
    The same thing when launching from Start-Run with the same command.
    How can I launch the app without the console window ? I know Eclipse has a .exe launcher that probably hides itself after starting the swt app. Any idea how could I do this ?

  • User profile image
    atehrani

    Use javaw

    The javaw command is identical to java, except that with javaw there is no associated console window. Use javaw when you don't want a command prompt window to appear. The javaw launcher will, however, display a dialog box with error information if a launch fails for some reason.

    Also you can also prefix your command with "start" in your batch file to open up another console window.

  • User profile image
    bart7simpso​n7

    That was it. Thanks a lot Smiley

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.