|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (8 bit)
Join Date: Sep 1999
Location: new york
Posts: 233
|
java related
hi
i'm a newbie. i have jdk1.2.2 for win98. i used notepad as editor and when i tried to save my first program as Welcome1.java it saved the file as Welcome1.java.txt. so i can't compile it. what i'm doing wrong? |
|
|
|
|
|
#2 |
|
Member (13 bit)
Join Date: Jul 2000
Location: Fullerton, CA
Posts: 7,030
|
Hi akmsr,
When you type in the name of the file add quotes around it, so name it: "Welcome1.java" If you don't add quotes it adds the .txt extension. Hope that helps.
__________________
"A witty saying proves nothing." - Voltaire |
|
|
|
|
|
#3 |
|
Member (8 bit)
Join Date: Sep 1999
Location: new york
Posts: 233
|
thanx drzaus, it worked. now the problem is can't compile it. i opened msdos promt, changed to the directory where i saved the Welcome1.java and typed javac Welcome1.java but it returned bad command or filename
|
|
|
|
|
|
#4 |
|
Member (13 bit)
Join Date: Jul 2000
Location: Fullerton, CA
Posts: 7,030
|
akmsr,
You need to add a path. Find the directory where the java compiler is and add this to your autoexec.bat: PATH C:\Java\bin\ where C:\Java\bin\ is the directory where your java compiler is. That way you can the run the java compiler from any directory, not just the directory where the compiler is. Now just type java filename in any directory and it should work (as long as filename exists in that directory). Also, you may want to use a text editor more powerful than notepad. I recommend EditPad Lite. It's free and easy to use and it lets you open more than one file at a time (using tabs). Hope that helps. |
|
|
|
|
|
#5 | |
|
Member (13 bit)
Join Date: Jul 2000
Location: Fullerton, CA
Posts: 7,030
|
akmsr,
Here is how to do it, directly from the Sun Java readme: Quote:
|
|
|
|
|
|
|
#6 |
|
Member (8 bit)
Join Date: Sep 1999
Location: new york
Posts: 233
|
thanx a lot worked like a charm
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|