GeeCON Prague 2014*
The moose likes Beginning Java and the fly likes open .java file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "open .java file" Watch "open .java file" New topic
Author

open .java file

supriya bharadwaj
Greenhorn

Joined: Dec 14, 2008
Posts: 11
how can we open the .java extension file on command prompt?

[Provided meaningful topic - Dave]
[ December 15, 2008: Message edited by: David O'Meara ]
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2057
When you say 'open' what do you mean?
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11352
    
  16

a .java file is a text file. any editor will do. every operating system will have SOMETHING you can use, whether it's DOS's "edit", Unix's vi or emacs, etc.

Since you use 'command prompt', I assume you are using Windows. you can probably type:

notepad <file>.java


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39072
    
  23
Please don't use thread titles like "java"; nobody knows what the thread is about.
supriya bharadwaj
Greenhorn

Joined: Dec 14, 2008
Posts: 11
open means to show each line of file on command prompt by which we can edit the syntax whenever it necessary.
supriya bharadwaj
Greenhorn

Joined: Dec 14, 2008
Posts: 11
i tried to open by your given command i.e notepad <filename>.java,but one error is coming that notepad is not recognized as an internal or external command.i am using windows.
James Tharakan
Ranch Hand

Joined: Aug 29, 2008
Posts: 580

-> edit filename.java


SCJP 6
Why to worry about things in which we dont have control, Why to worry about things in which we have control ! !
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39072
    
  23
Originally posted by James Tharakan:
-> edit filename.java


I never knew that; thank you. That works on Windows.
[ December 15, 2008: Message edited by: Campbell Ritchie ]
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Originally posted by supriya bharadwaj:
i tried to open by your given command i.e notepad <filename>.java,but one error is coming that notepad is not recognized as an internal or external command.i am using windows.

You should have opened it using Start > Run (or winkey+r, or via start menu, accessories and so on), not as a command in the command console. It is not a DOS command or so, but just a win32 executabele.
supriya bharadwaj
Greenhorn

Joined: Dec 14, 2008
Posts: 11
ok...thanks...
 
GeeCON Prague 2014
 
subject: open .java file