Welcome to Dream.In.Code
Become a Java Expert!

Join 150,418 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,102 people online right now. Registration is fast and FREE... Join Now!




Help compiling through command prompt

 
Reply to this topicStart new topic

Help compiling through command prompt

jingoria
31 Mar, 2008 - 12:30 PM
Post #1

New D.I.C Head
*

Joined: 22 Oct, 2007
Posts: 41


My Contributions
Hi I was trying to compile my program through command prompt but I am not getting it. Please tell me how to do that.
This is the path to my file:
C:\Users\Robogeek\Documents\University Stuff\Cosc\Cosc 1320\Java
and the name of file is BabylonianRoot.
Please tell how would I access the file from command prompt and then compile it.
Please go step by step.

Thanks.
User is offlineProfile CardPM
+Quote Post

pbl
RE: Help Compiling Through Command Prompt
31 Mar, 2008 - 01:00 PM
Post #2

D.I.C Lover
Group Icon

Joined: 6 Mar, 2008
Posts: 3,589



Thanked: 233 times
Dream Kudos: 75
My Contributions

If it is a Java program the name of the file must be BabylonioanRoot.java

Then cd to your source directory and:

JAVAC BabylonianRoot.java

if JAVAC generate an error "command not found" you must add the java/bin directory into you class path
Start
MyComputer
ViewSystem Information
Advanced
Environment Variables

and Edit PATH on include the path of your JAVA engine which should be something like
C:\Program File\Java\jre1.6.0\bin

to execute the program

JAVA BabylonianRoot


User is online!Profile CardPM
+Quote Post

love4life
RE: Help Compiling Through Command Prompt
1 Apr, 2008 - 06:13 AM
Post #3

New D.I.C Head
*

Joined: 31 Mar, 2008
Posts: 11


My Contributions
before i figured out the path so i could compile in the directory of the file I would just copy the file into the java bin folder, than just copy it and the class file to a new folder . Its kinda cheesey but my professor could tell me how to create the path. :-) Some professor huh.
User is offlineProfile CardPM
+Quote Post

jingoria
RE: Help Compiling Through Command Prompt
4 Apr, 2008 - 07:20 PM
Post #4

New D.I.C Head
*

Joined: 22 Oct, 2007
Posts: 41


My Contributions
QUOTE(jingoria @ 31 Mar, 2008 - 01:30 PM) *

Hi I was trying to compile my program through command prompt but I am not getting it. Please tell me how to do that.
This is the path to my file:
C:\Users\Robogeek\Documents\University Stuff\Cosc\Cosc 1320\Java
and the name of file is BabylonianRoot.
Please tell how would I access the file from command prompt and then compile it.
Please go step by step.

I am in the right directory. But I am not able to access my files. It seems there is some command to access a file. When I tab to a folder and pressn ENtER, I get this error
"Documents" is not recognized as an internal or external command, operable program or batch file.
Thanks.


User is offlineProfile CardPM
+Quote Post

pbl
RE: Help Compiling Through Command Prompt
4 Apr, 2008 - 07:28 PM
Post #5

D.I.C Lover
Group Icon

Joined: 6 Mar, 2008
Posts: 3,589



Thanked: 233 times
Dream Kudos: 75
My Contributions
QUOTE

When I tab to a folder and pressn ENtER, I get this error
"Documents" is not recognized as an internal or external command, operable program or batch file.
Thanks.

Don't panic :-)

When I tab to a folder ?

On which platform are you Windows or Linux ?

Are you at the console/Dos prompt ?
User is online!Profile CardPM
+Quote Post

jingoria
RE: Help Compiling Through Command Prompt
4 Apr, 2008 - 07:54 PM
Post #6

New D.I.C Head
*

Joined: 22 Oct, 2007
Posts: 41


My Contributions
QUOTE(pbl @ 4 Apr, 2008 - 08:28 PM) *

QUOTE

When I tab to a folder and pressn ENtER, I get this error
"Documents" is not recognized as an internal or external command, operable program or batch file.
Thanks.

Don't panic :-)

When I tab to a folder ?

On which platform are you Windows or Linux ?

Are you at the console/Dos prompt ?


I got it. I was using the cd and dir command incorrectly. Now I am able to access my file but when I give the compile command


QUOTE(pbl @ 4 Apr, 2008 - 08:28 PM) *

QUOTE

When I tab to a folder and pressn ENtER, I get this error
"Documents" is not recognized as an internal or external command, operable program or batch file.
Thanks.

Don't panic :-)

When I tab to a folder ?

On which platform are you Windows or Linux ?

Are you at the console/Dos prompt ?


I got it. I was using the cd and dir command incorrectly. Now I am able to access my file but when I give the compile command
JAVAC BabylonianRoot.java
Nothing shows up on my screen. Instead it prints just the name of the directory where I started from.

User is offlineProfile CardPM
+Quote Post

pbl
RE: Help Compiling Through Command Prompt
4 Apr, 2008 - 07:58 PM
Post #7

D.I.C Lover
Group Icon

Joined: 6 Mar, 2008
Posts: 3,589



Thanked: 233 times
Dream Kudos: 75
My Contributions
QUOTE(jingoria @ 4 Apr, 2008 - 08:53 PM) *

I got it. I was using the cd and dir command incorrectly. Now I am able to access my file but when I give the compile command


what happens whenyou give the compile command ?


I don't know on which time zone you are but I am about to go to bed so answer quickly
User is online!Profile CardPM
+Quote Post

jingoria
RE: Help Compiling Through Command Prompt
4 Apr, 2008 - 09:49 PM
Post #8

New D.I.C Head
*

Joined: 22 Oct, 2007
Posts: 41


My Contributions
QUOTE(pbl @ 4 Apr, 2008 - 08:58 PM) *

QUOTE(jingoria @ 4 Apr, 2008 - 08:53 PM) *

I got it. I was using the cd and dir command incorrectly. Now I am able to access my file but when I give the compile command


what happens whenyou give the compile command ?


I don't know on which time zone you are but I am about to go to bed so answer quickly


I got it. It works fine.

Thanks for all your help.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 08:21PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month