How to send a java file?
Hello, I started learning Java about a week ago.
I wonder how I can send my (small) programs I made in Java to someone else.
I mean: when i was programming in C++ and when I built a file, there was automaticly a new .exe file added to the bin. So I could send that .exe file and then could open it on the other pc without having to do anything special.
How can I do this in Java?
actually making a exe files into java is not a difficult process but it isnt as easy C or C++.
if you want to send java application . try sending them the .java files , .class files are not the files to be sent
Acctually, if you want the other person to just run the app and not see the source, .class files are the ones to send.
thx both for the fast answer, I don't know yet how to do it though.
problems: if I send the .class ,how to open it on the other pc? (can't even run a .class on my own pc :s)
if I send the .java ,I can only open it with text editors and Eclipse/codeblocks::
tbh i think the .class is the correct answer (sounds the most logical), but then still, how to open it?
i guess there isnt a way to just convert the .class (or .java) into a simple .exe file?
I never really delved into making .exe files from java apps, bom running the class file is what you do if you compile your programs in cmd:
But since we do have jar files, I think it's the preffered way to do this (just personal opinion, your mileage mmay vary :D).
aha jar files that sounds good .. (I have to tell u I'm pretty nooby with cmd and jar files) but I guess jar files are axecutables and can be made from a .class :)
how to make the .jar
I'll wait with this until I rly have something worth sharing :p
thx for all help :)
Yeah, since pretty much everyone and their dog already has java on their computers, .jar files are just as practical as .exe. Most IDE's have a jar creation wizard, also have a look at this:
Sun tutorial on jar files.
aha this solves everything :)
this thread can be locked
thx a lot! :D