• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java On DOS Platform : Urgent

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Neeraj,
After you compile to .class file. Just rename it to .cls

Thanks
Angela
 
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just out of curiosity -- why are you writing java programs in dos?
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic