Jump to content
xisto Community
peroim

What To Do With .java Files?

Recommended Posts

You would compile the .java files into .class files. There you can either run them using the java nameofprogram command or include them into a website if the class file extend JApplet. There isnt much else to do with the code besides run it.

Share this post


Link to post
Share on other sites

You can actually throw away the .java files after you compile it and the .class files is your final work... However, if you ever need to edit your work again its better you keep that .java files so that next time you could work on it from there instead of starting all over... Java is portable so you just have to have the .class file in order to work on almost all operating system or website that have the java virtual machine or something... :lol:

Share this post


Link to post
Share on other sites

Ok, I "know" Java, but what now? What do you do with the .java files? (I'm interested in both java-applets and java-programs.)
Thanks, Peroim.


hey, .java is just the java program source file, if you wanna make it run you need to compile them to .class file by javac.exe that is included the the JDK (Java Develop Kit), current i use the 5.0 version of jdk, after install JDK on your computer and setup the neccessary environment correctly, ok open command line and change directory to the <JDK_HOME>/bin, and use the follow command.

> javac pkgname.classname.java

without error ,ok you gotta the class code of java now, it's not easy to compile during abrove way especially you wanna compile a java project, so you can use Eclipse or NetBean both are wonderfull open-source java IDE, i prefer to use Eclipse and have working on java with eclipse for most a year, when you edit java source code in eclipse when you save the code, ok the file has already compiled to the class file now,

cool, right.? i think so. happy java

Share this post


Link to post
Share on other sites

Ok, I "know" Java, but what now? What do you do with the .java files? (I'm interested in both java-applets and java-programs.)
Thanks, Peroim.



hi there!

i'll use the java programming language since years, and i found something, witch everyone will love...

never need to compile your java sourcecode via console, have a "code-expender" (press crtl + space, popup apears, choose method etc.)

well, this program is called "eclipse" and you can get it from http://www.ecplipse.org/

direct me to the DL site

if you don't use this app you need to compile the sourcefile by yourself, witch means you have to switch in a command - box, goto rootdir/programme/sun/java/bin (the bin directory of your java installation)
and enter "javac sourcecodename" where the sourcecode name is without the extension (.java).

this will compile your .java into a bytecode (.class file).

next, you have to type "java sourcefile" in the same directory...


with eclipse you may have up to 1000 workspaces, and it will be easy to compile your code...

(simple press crtl + x, j and there it goes :lol:)

sorry, but my english isn't verry well cuz i'm a german user (not *BLEEP*ing germany, from austria ^^)


have a nice day

Share this post


Link to post
Share on other sites

Hi All,I started to deal with Java and jsp about a month ago. As I still consider myself as a rookie, I have read lots of tutorials, howtos about jsp, java and applets.In every JDK installation there is written to set the PATH variable (or JAVA_HOME and CLASSPATH variable, in case of linux). If you do that, then there is no need to go to the Java/bin folder for compiling (or for any other program launching).I hope this helps someone.Regards,Marrow

Share this post


Link to post
Share on other sites

hi everybody,thanks for the replies. i've got NetBeans installed and now i know how to compile java files, i can start learning java :P Peroim

Share this post


Link to post
Share on other sites

Well with JAVA you can do almost everything, and really everything. However if you want to program applet's as you pointed out in the first post. You have to know inheritance as you extend applet class and you have to know bits and bytes of html. Applets are really cool when you get used to it. It is a bit different from programming in java as now it is not linear not at all. You could place several objects and they would be posted and you have to have a bit sense for graphics. Also the best way to run applets is not your browser but rather appletviewer which can be used in your cmd that is command prompt in windows.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.