File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java On DOS Platform : Urgent

 
Neeraj Thakkar
Ranch Hand
Posts: 80
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,

I want to know that when we create a java file it has extension .java and the class file generated is .class
But DOS only supports 3 characters as extension. What if wanna write and runa an application on DOS alone.
It's very urgent. Plz help
Neeraj
 
amer seif el dine
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am not sure but try it!
there is a dos editor.
try:
edit File_Name.java
i repeat try it coz i don't know if it works
but this is a simple idea to try !
good luck
plz inform me if it works.
byez
 
Neeraj Thakkar
Ranch Hand
Posts: 80
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Amer,
Got ur reply but friend when u save a file in DOS Editor it will truncate the last chars after 3 chars
so the file saved will be file.jav and not file.java and forget about the .class file.
I hope it is like this only. just check it out.
Bye
Neeraj
 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
Neeraj,
are you running a DOS only PC or are you running DOS under some version of windows? You may find that your DOS version will support long filenames but the DOS Editor will not. In that case, you can save your file and then copy or rename it back to the .java extention that you need for compliation.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of DOS are you using? I currently compile and run Java on Win95, Win98 and WinNT at various times. I don't use an IDE - just raw DOS and notepad to save and execute from. There is no problem with the .java or .class extensions.
 
Neeraj Thakkar
Ranch Hand
Posts: 80
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for the reply.
When u compile ur program from DOS PROMPT in Win 95/98/NT then there is no problem.
The reason the MSDOS PROPMPT is an application that simulates DOS and as Win 95/98/NT support long file names so does the DOS PRMPT so don't confuse the DOS PROMPT Application with DOS which is an OS.
Let me put it more clearly I have a system with only DOS installed on it there is no Win95/98/NT. How do I execute Java Programs there.
Forget about the DOS Editor that renaming can be done but what if ur OS doesn't allow more than 3 chars as Extension.
I hope I have made it clear.
Neeraj
 
Angela Jessi
Ranch Hand
Posts: 428
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Neeraj,
After you compile to .class file. Just rename it to .cls

Thanks
Angela
 
David Weitzman
Ranch Hand
Posts: 1365
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just out of curiosity -- why are you writing java programs in dos?
 
Lucas Richardson
Ranch Hand
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
He can't compile it if he's using dos 6.x or earlier though. Javac only takes a file with an extension of .java, correct? Even .jav doesn't work..
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic