3

I wrote a simple Java GUI to execute some MS-DOS commands. So this program would only work on Windows.

I have converted the class to executable jar. I think that is what it is. I can double click on the JAR file and off it runs. The problem with double clicking the jar file is that I can't run it as Administrator and can't pin it on the Windows 10 menu as a Tile.

When I try to convert it to exe using Jar2Exe, Jsmooth or Jwrapper, I obtain what looks like an .exe file. But when I double click that exe file with the icon I provided, nothing happens.

For example, in JWrapper it look like its loading for 1 or 2 secs (small blue circle round and round) and then nothing. If I press Ctrl-Alt-Del (Task Manager) I see the appname-windows32-offline.exe running though. But the GUI isn't shown and I can't click on anything to activate any command lines.

Can someone help me find out what is wrong?

MWiesner
  • 8,868
  • 11
  • 36
  • 70
Azrudi
  • 101
  • 1
  • 7
  • 1
    Did you run it from command line to check whether the application/runtime prints anything? – Thomas Jan 11 '16 at 15:40
  • More on the command line: you can run it as an administrator from there too, if you run cmd as an administrator. Won't fix the windows 10 Tile issue. – Patrick Stephen Jan 11 '16 at 15:41
  • @Thomas & Patrick What do you mean run from the command line, do you mean run the .jar or the .exe? (I guess the answer is I haven't, I'll do both now). There was no System.out.println command in the java class/jar, I assume you mean something else could be printing something? – Azrudi Jan 12 '16 at 15:58
  • I meant running the .exe from a cmd window to see whether some message is being printed (might provide a hint on the error). I'd guess Patrick means if you run the cmd window with admin privileges and call the .jar from there it should run with admin privileges as well (and you could do that using a batch file as well, just google a bit). – Thomas Jan 12 '16 at 16:01
  • Hi @Thomas, I gave that a try (running the .exe from the command line). Nothing appears in the command window. Just blank space and then back to the prompt. Windows thinks its running (its in the Task Manager) but it is not. Maybe JWrapper, Jsmooth etc expects me to write an include or something obvious which I haven't done. I added a package com.appname.apptype at the beginning of the .java though, I am not sure if that's important. Should I paste my java code here? – Azrudi Jan 12 '16 at 16:09
  • When you run the executable built by JWrapper it will log to file, both for the launch and for your app, so you may be able to see what is going wrong in those files - http://www.jwrapper.com/debugging-with-jwrapper.html – AntonyM Jan 12 '16 at 18:12
  • I meant to update on this. I moved to Launch4j and got it working – Azrudi Nov 26 '16 at 12:44

0 Answers0