Skip to main content

Compiling

1 reply [Last post]
yavo
Offline
Joined: 2011-12-24

Hi, I've finished coding my program and now i want to compile it. It's the first time I'm actually compiling a program since I use JCreator to code and test my programs. But this time I wanted to make it an acutal program by compiling it. I have no idea about compiling. So I thought I could ask you guys for some help. How can I compile my program? What am I supposed to get after i compile it? Am I going to be able to run it by simply double clicking? Thanks in advance.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
abubakargurnah
Offline
Joined: 2011-06-07

Compiling your code
# javac yourClassName.java

Running your code
# java yourClassName

If you want to double click to run your code you have to create a jar file

#jar cf jar-file input-file(s)

check more here
http://docs.oracle.com/javase/tutorial/deployment/jar/build.html