English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I just started a Java Programming Course online and it gave us example programs that we were supposed to modify. I opened and made the modifications but they only let me save them as text files and the only way to compile them is if they are "Java" files. Can someone tell me how to fix this?

2007-02-08 04:41:35 · 3 answers · asked by Anonymous in Computers & Internet Programming & Design

3 answers

Saving the file won't compile the file, that only saves the uncompiled code to disk. You might want to read a Java tutorial on the Sun website (http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html). The example is the typical "hello world" application but it gives you the basic idea of how to compile a simple program. Now if you start to get a bit more serious about coding, consider using a Java IDE. I use WebLogic Workshop (http://www.bea.com) but it isn't exactly a free IDE. Some developers here use the free Eclipse IDE (http://www.eclipse.org) but I can't say that I've used it. JEdit is another that some developers swear by but I haven't used it.

If you find that you need to continually rebuild a project, consider looking into using Ant (http://ant.apache.org/) to create a controlled build environment. I wouldn't necessarily jump right into this though if you are only doing fairly simple programs. The learning curve isn't too steep though so check it out and see if you want to implement.

2007-02-08 04:56:53 · answer #1 · answered by Jim Maryland 7 · 0 0

What you really want to do is to download Sun's Java SDK 1.4 or higher, this comes with a Java compiler. For serious Java development use an IDE (integrated development environment) a great free on is Eclipse.

2007-02-09 00:49:25 · answer #2 · answered by KnightSpot 2 · 0 0

I think you must be using NOTEPAD for saving your java file.. What you can do then is as you SAVE it, it will ask you for a file name. And instead of saving as say HelloWorld.java, save it as "HelloWorld.java" i.e. with quotes or else notepad will rename it automatically as HelloWorld.java.txt which might be your present case.

Hope this helps..

2007-02-08 12:51:00 · answer #3 · answered by Dolphy F 1 · 1 0

fedest.com, questions and answers