Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-18-2007, 07:30 PM
Member
 
Join Date: Jul 2007
Posts: 35
silvia is on a distinguished road
type javac on the command line from any directory of your machine
I have a question. I did everything it said to install, and it gave me a test to see if everything was right, it said, "type javac on the command line from any directory of your machine."
I assumed that meant go to start, then run and type in javac.
However when I do that a Dos window or whatever it's called comes up for just a second, and then closes down.
According to the tutorial it should come up with instructions on how to run javac.
It might be doing that (there's several lines of writing that comes up when I do that) but it keeps closing down. If that is the right thing to do (going to start -> run -> type javac) then how do I get the window to stay up longer, if it's not the right thing to do what is?

Thanks
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-19-2007, 06:41 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,564
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Javac is just a executable file used to run your *.java file. Have you check the bin folder on Java installation folder of your system. You can see that, it's just an exe file. You can't hold it. If you type javac on Run, it start to sun, and looking the *.java file. If it is not found such a file, close itself.

If you have put the link of that tutorial, I check that what it says.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-19-2007, 03:15 PM
Member
 
Join Date: Jul 2007
Posts: 9
vata2999 is on a distinguished road
I think after you setup your JDK you should set windows path in
environment variables
path=E:\Program Files\Java\jdk1.5.0_01\bin
and set JAVA_HOME=E:\Program Files\Java\jdk1.5.0_01

javac is java compiler it means you can compile java file from ms-dos prompt
start -> run -> cmd
javac filename.java
after you compile your file javac generate class file
to run class file
java filename

Last edited by vata2999 : 07-19-2007 at 03:18 PM. Reason: MISSING SOMTHING
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 07-19-2007, 06:49 PM
Senior Member
 
Join Date: Jul 2007
Posts: 130
cruxblack will become famous soon enough
Quote:
"type javac on the command line from any directory of your machine."
it doesn't mean to type it from start->run, da command line means that u gotta write javac followed by .java extension file in the command prompt (cmd.exe in windows)

U could find the command prompt from
Start->All Programs->Acessories->Comand Prompt
or u can just type cmd in the Start->run

bout setting the environment variables, besides of what vata2999 just said, u can also do it from da command prompt
just type SET PATH=%PATH%;<da path for ur jre or jdk bin folder right here>

example : SET PATH=%PATH%;C:\Program Files\Java\jdk1.6.0\bin

Initially if u dun change the location when u install java, thats the default location of ur java tools
U can also set da classpath in da same way so that u can put all the source code (.java) u created in a specific folder and then just compile it using javac without having to write ur source code full address all da time

hope this helps silvia
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 07-20-2007, 06:18 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,564
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Another alternative I have to setup the path.

WorkingFolder>path=c:\Program Files\Java\jdk1.6.0\bin

But the easiest way is editing the AUTOEXEC.BAT file, if you are working on Notepad and Command Prompt.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command line argument denisatandi New To Java 3 06-15-2008 08:59 AM
Java command line agouzoul New To Java 2 04-02-2008 02:12 PM
javac not recognized as an internal or external command kotoko New To Java 6 11-05-2007 02:39 PM
Exporting from the command line o1121 Eclipse 1 08-09-2007 09:29 PM
Unable to execute command line command in java LordSM New To Java 1 08-08-2007 02:23 AM


All times are GMT +3. The time now is 10:19 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org