I use .bat file to launch Java programs on Windows, what about on a Mac?

I have different simple Java programs on my PC that I kick off with a .bat file, the only line in the file is:

start javaw -classpath . main/Main

and it starts my Java application.

Mac users, what do I do to make this work on a Mac? I want a simple clickable icon like a .bat file that I can launch on the Mac. Isn't there some kind of .command file for Macs, is that the key? I couldn't figure it out. I have zero knowledge of Macs, but my wife just bought one because she wanted to have one for various reasons, but I need to get these Java apps to run.

Could some kind soul help me out and it explain it like you were talking to an idiot? :) Thanks.

[687 byte] By [rocketguya] at [2007-11-27 2:24:20]
# 1
http://java.sun.com/docs/books/tutorial/deployment/jar/
CaptainMorgan08a at 2007-7-12 2:31:12 > top of Java-index,Java Essentials,Java Programming...
# 2
So I have to use a jar file on a Mac? I can't just use the class file that I've been using on a PC?
rocketguya at 2007-7-12 2:31:12 > top of Java-index,Java Essentials,Java Programming...
# 3
A jar file will be able to run on a PC or a Mac.
CaptainMorgan08a at 2007-7-12 2:31:12 > top of Java-index,Java Essentials,Java Programming...
# 4
Ok, thanks, I'll just do it that way then. Thanks a lot!
rocketguya at 2007-7-12 2:31:12 > top of Java-index,Java Essentials,Java Programming...
# 5

On a related note, there is something else I need to change in my code to become mac compatible. I have a program that alters some text and at the end I pop up my output in notepad on the PC. Well, I don't have that on a mac anymore. Is there a way to pop up Mac's textedit program similar to this way that I was doing the notepad on the PC:

Process p=Runtime.getRuntime().exec("notepad.exe "+outputfile);

Thanks!

rocketguya at 2007-7-12 2:31:12 > top of Java-index,Java Essentials,Java Programming...
# 6
If you use java 1.6+ check the Desktop class, specifically the edit(File file) method in it. /* Launches the associated editor application and opens a file for editing.*/
Ruly-o_Oa at 2007-7-12 2:31:12 > top of Java-index,Java Essentials,Java Programming...
# 7

> If you use java 1.6+ check the Desktop class,

> specifically the edit(File file) method in it.

> /* Launches the associated editor application

> and opens a file for editing.*/

Thanks, but unfortunately I'm using 1.5. But fortunately, I found this which works! :)

Runtime rt = Runtime.getRuntime();

rt.exec("open "+outputfile);

Thanks :)

rocketguya at 2007-7-12 2:31:13 > top of Java-index,Java Essentials,Java Programming...