Computer Science Canada

javac in cmd; the only way???

Author:  Spartan_117 [ Wed Aug 10, 2005 1:59 pm ]
Post subject:  javac in cmd; the only way???

Is there a way to execute a class file without using java in the command prompt? Like an .exe file?

Author:  wtd [ Wed Aug 10, 2005 2:06 pm ]
Post subject: 

You don't use javac to execute a class file. Smile

Author:  Spartan_117 [ Wed Aug 10, 2005 4:54 pm ]
Post subject: 

lol, my mistake.

You know what i mean! Razz

Author:  wtd [ Wed Aug 10, 2005 5:41 pm ]
Post subject: 

http://forum.java.sun.com/thread.jspa?threadID=555662&messageID=2801012

Author:  [Gandalf] [ Wed Aug 10, 2005 7:33 pm ]
Post subject: 

Either make it a .jar file, or do a google search for a Java .exe maker or something like that. I found quite a few a while ago - they just take the .class files and everything you have and make a executable out of them.

I think that's what you mean...

Author:  Spartan_117 [ Thu Aug 11, 2005 12:52 pm ]
Post subject: 

[Gandalf] wrote:
Either make it a .jar file, or do a google search for a Java .exe maker or something like that. I found quite a few a while ago - they just take the .class files and everything you have and make a executable out of them.

I think that's what you mean...


Yup thats exactly what i mean. So i can just search for a Java .exe maker? Ok ill try that.

Author:  rizzix [ Thu Aug 11, 2005 2:35 pm ]
Post subject: 

meh.. y not just execute a "java -cp . classname" from java? ... like this:

code:
Runtime.getRuntime().exec("java -cp . classname");
it should start a new java process..

Author:  Spartan_117 [ Fri Aug 12, 2005 8:11 am ]
Post subject: 

rizzix wrote:
meh.. y not just execute a "java -cp . classname" from java? ... like this:

code:
Runtime.getRuntime().exec("java -cp . classname");
it should start a new java process..


So that makes the class file an executable??? WHere do i put that code?

Author:  rizzix [ Fri Aug 12, 2005 3:35 pm ]
Post subject: 

hmm? what do u mean.. makes it an executable..

i'm just showing you a way for executing another java program.. from within a java program.

Author:  Spartan_117 [ Fri Aug 12, 2005 3:48 pm ]
Post subject: 

Oh, no thats not wut im trying to do tho, im trying to make the .class file work like a .exe file, so when i double click it, itll automatically start the program.

Author:  rizzix [ Sat Aug 13, 2005 8:16 am ]
Post subject: 

aah! yep.. u need special software for this..

this is a good one: http://jsmooth.sf.net

Author:  Spartan_117 [ Mon Aug 15, 2005 7:13 am ]
Post subject: 

Thanx man, ill use that.


: