Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 05-27-2001, 10:13 PM   #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?
akmsr is offline   Reply With Quote
Old 05-27-2001, 10:52 PM   #2
Member (13 bit)
 
DrZaius's Avatar
 
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
DrZaius is offline   Reply With Quote
Old 05-27-2001, 11:28 PM   #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
akmsr is offline   Reply With Quote
Old 05-27-2001, 11:40 PM   #4
Member (13 bit)
 
DrZaius's Avatar
 
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.
DrZaius is offline   Reply With Quote
Old 05-27-2001, 11:45 PM   #5
Member (13 bit)
 
DrZaius's Avatar
 
Join Date: Jul 2000
Location: Fullerton, CA
Posts: 7,030
akmsr,

Here is how to do it, directly from the Sun Java readme:
Quote:
To set the PATH permanently, open the AUTOEXEC.BAT file and add or change the PATH statement as follows:

1. Start the system editor. Choose "Start", "Run" and enter sysedit, then click OK. The system editor starts up with several windows showing. Go to the window that is displaying AUTOEXEC.BAT.

2. Look for the PATH statement. (If you don't have one, add one.) If you're not sure where to add the path, add it to the right end of the PATH. For example, in the following PATH statement, we have added the bin directory at the right end:

PATH C:\WINDOWS;C:\WINDOWS\COMMAND;C:\JDK1.2.2\BIN

Capitalization doesn't matter. The PATH can be a series of directories separated by semi-colons. Microsoft Windows searches for programs in the PATH directories in order, from left to right. You should only have one bin directory for the Java 2 SDK in the path at a time (those following the first are ignored), so if one is already present, you can update it to 1.2.2.

3. To make the path take effect in the current Command Prompt window, execute the following:

C:> c:\autoexec.bat

4. To find out the current value of your PATH, to see if it took effect, at the command prompt, type:

C:> path
Hope that helps.
DrZaius is offline   Reply With Quote
Old 05-27-2001, 11:53 PM   #6
Member (8 bit)
 
Join Date: Sep 1999
Location: new york
Posts: 233
thanx a lot worked like a charm
akmsr is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 07:23 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2