File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes How to compile/interpret ur own package's classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to compile/interpret ur own package Watch "How to compile/interpret ur own package New topic
Author

How to compile/interpret ur own package's classes

Malik Tahir
Greenhorn

Joined: Sep 29, 2001
Posts: 18
hi,
i m getting error when i compile this code:
package A;
class B {
public static void main (String arg[]){
System.out.println("Hello");
}
}
I made a folder in jdk1.3 with the name of A and put this file in that folder. And then compile it with the command C:/jdk1.3/bin>javac A.B.java
I have tried even C:/jdk1.3/bin>javac B.java
but compiler complaints that it did'nt find this class.
Plz help me out.
Thanks in advance
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5371
try :
C:/jdk1.3/bin/A>javac B.java


"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
Malik Tahir
Greenhorn

Joined: Sep 29, 2001
Posts: 18
Hi Ravish,
I tried that one but still i m getting the message "Bad Command or File name".
Thanks
Tahir
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
"Bad command" is because the "javac" command is not recognized since you are not in the bin directory. What I recommend you to do is set your PATH variable to include C:\jdk1.3\bin and that way you can call javac from anywhere.
Moreover, I'm moving this to Java in General (Beginner).
HIH
[ January 15, 2002: Message edited by: Valentin Crettaz ]

SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Malik Tahir
Greenhorn

Joined: Sep 29, 2001
Posts: 18
Hi Valentin,
Thanks a lot for ur valuable recommendation.
Plz tell me how can i set path. i m using windows and notepad.
Thanks in advance
Tahir
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Go to Windows help and look it up.
You need to include the location of your bin library - someting like:
PATH .;D:\jdk1.3.1\bin;D:\jdk1.3.1\MyStuff;%PATH%;
Younes Essouabni
Ranch Hand

Joined: Jan 13, 2002
Posts: 479
Can you tell us which windows are you using?


Younes
By constantly trying one ends up succeeding. Thus: the more one fails the more one has a chance to succeed.
Malik Tahir
Greenhorn

Joined: Sep 29, 2001
Posts: 18
hi,
I m using Window 98.
Marius BONG
Greenhorn

Joined: Dec 16, 2001
Posts: 13
you have to go to dos and make sure your path is C:\
then type:
C:\edit autoexec.bat
if the blue screen is empty, click file and open file called autoexec.bat
in autoexec.bat add in this line:
SET PATH C:\jdk1.3.1\bin
and then restart your windows. you will be able to compile and run your java where ever you like.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to compile/interpret ur own package's classes