4

Firewall problem:
When I run a jar or a class in windows, windows reports it as java.exe. How can I instruct windows to report it with the name of the jar or class.

Eg. java -jar myapp.jar

The firewall sees it as java.exe. The problem is that I cannot allow any jar to pass thru the firewall.

Stefan Rasmusson
  • 5,445
  • 3
  • 21
  • 48
Leon
  • 198
  • 1
  • 7
  • but...but... Java.exe is the application... Unless you compile it as an exe, Java.exe is going to have to run it, compile it, etc... Good Question Though. – SchautDollar Feb 11 '13 at 21:06

2 Answers2

2

You can wrap your Java application in its own executable.

There are a number of tools that will generate this executable for you. My favorite is exe4j. Others are listed in many other stackoverflow questions about creating an executable for a Java program, such as this one.

Community
  • 1
  • 1
Andy Thomas
  • 84,978
  • 11
  • 107
  • 151
  • Thanks Andy. But it was not the kind of solution I was after... I know about those tools. I didn't want to loose my portability. – Leon Feb 12 '13 at 18:54
  • You can make a \*.exe wrapper *and* keep portability for other operating systems. I've done this while delivering on Windows and OS X and elsewhere. – Andy Thomas Feb 12 '13 at 19:06
0

You must have a launcher EXE properly named which runs your code. Launch4j can do this if properly configured, but with an extra step with temp files at launch time.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347