• Welcome to Valhalla Legends Archive.
 

Standalone .exe's?

Started by iago, December 06, 2003, 04:14 PM

Previous topic - Next topic

iago

How do you make standalone .exe files in Java? I know I've seen them before, and it would be nice to be able to.

Thanks!
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Kp

(and does so by default).  Don't know if there are other things which can do so.  Note that, as a native exe, it won't have the portability of a normal .class file.  Also, it is probably not possible to decompile it back into the original .java file (however, a .class file can supposedly be fully decompiled).
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Hostile

Yes, its more then possible to decompile java classes, which is quite obvious as to why. I think its even a feature in JBuilder iirc. You can also disassemble classes though javap which is provided with JDK. Yes, obviously there are ways to make .exes with java, however as Kp noted its not by the terms "100% Pure Java", which contrary takes away all of javas portability and there for needs to be recompiled on different platforms. If you're looking for a way to execute java as a standalone then theres an alternative to not taking away its portability, use .jar files. If system paths are configured correctly can use a jar file to execute a class thats archived inside the jar file (which is its main purpose).
- Hostile is sexy.

Kp

...is that you can optimize the code.  Native code tends to run faster than bytecode, especially when you let the optimizer take a crack at it.  If you run into some pre-existing Java code that you really need to perform well, compiling it native may be the solution if you don't have time to do the sensible thing (porting it to a language where speed was a design consideration ;)).
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

iago

My main reason is that I want to be able to show programs to my friend/whatever, but if he can't run .class files easily (perhaps doesn't have the stuff installed)
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Kp

I'm pretty sure most Windows OSes will have some sort of Java VM installed already (whether this is good or not is another issue...)
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Banana fanna fo fanna

Quote from: Kp on December 07, 2003, 11:24 AM
I'm pretty sure most Windows OSes will have some sort of Java VM installed already (whether this is good or not is another issue...)

No.

iago

By default, windows can't do anything with .class files afaik.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Kp

... without having explicitly installed it on any of them, all the computers I have access to have a Java VM (java.exe) already installed.  It's not associated with .class in the Windows shell, so Windows doesn't think it can do anything with them, but you can use it to run the class files from the command line.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

iago

... which is why I want to be able to make .exe's instead of having .class files.  It's fine if it's still bytecode+VM, as long as they don't need installed software to use it.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


j0k3r

If you had a .class file, and had VM installed, would it just open a window and run it? Because I'm pretty sure about 90% of the computers out there have VM installed.
QuoteAnyone attempting to generate random numbers by deterministic means is, of course, living in a state of sin
John Vo

Banana fanna fo fanna

1) I'm pretty sure they don't have the VM
2) Clicking a class file won't do anything, however, an executable JAR would do something if the VM is installed.

iago

Quote from: j0k3r on December 08, 2003, 06:41 AM
If you had a .class file, and had VM installed, would it just open a window and run it? Because I'm pretty sure about 90% of the computers out there have VM installed.

90% just doesn't cut it all the time :P

This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Hostile

Quote from: St0rm.iD on December 08, 2003, 08:16 AM
1) I'm pretty sure they don't have the VM
2) Clicking a class file won't do anything, however, an executable JAR would do something if the VM is installed.

I already said that, and almost any computer with a webbrowser has the Java VM. iago, I think you should just consider some sort of executable solution(.jar or .exe) or some more inconvienent alternative, like an applet.
- Hostile is sexy.

Banana fanna fo fanna

Quote from: Hostile on December 08, 2003, 05:57 PM
Quote from: St0rm.iD on December 08, 2003, 08:16 AM
1) I'm pretty sure they don't have the VM
2) Clicking a class file won't do anything, however, an executable JAR would do something if the VM is installed.

I already said that, and almost any computer with a webbrowser has the Java VM. iago, I think you should just consider some sort of executable solution(.jar or .exe) or some more inconvienent alternative, like an applet.

Um no. The Java VM you're talking about works for Java 1.1...and I don't think they usually support standalone JARs or apps, either.