File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No console window when running manifest file?

 
Christopher Young
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is more of a question on programming concept than anything.

After 7 or 8 months of experience in Java, I'm still quite comfortable using the console window for IO for my program (although I'm not using commandline). I just recently saw a fellow student create a manifest file with an applet that allowed the .jar file to be clicked on to run the program. This I found rather useful because it allows portability without having to always launch from the IDE I'm using (CodeWarrior). I noticed that there is no console window when using the manifest file (programs I make manifests with that have no GUI do not come up at all, as if they're dead). This is fine as I intend (for, at least, programs I'd like to show off) to use a fancy GUI, but the observation led me to an interesting question.

Is the console window just there as a debugging tool? I mean, is it not intended for larger projects and just used for development to roughly see where the program is going and such? Or is this just something to do with my IDE and can java programs be run as stand-alone from the console?
 
Campbell Ritchie
Sheriff
Pie
Posts: 47274
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "console" window is left over from the days when every program was executed by typing its name on screen; it is a way to instruct the computer to do something directly. It was used a lot on *nix systems and DOS, but much less on Windows. It is also called a terminal window, or a shell, or command prompt, on different OSs.
So it is regarded as the standard access to your OS, but only in the last versions of Java (J6) was there an explicit Console class. Any Java program can be run as a standalone application from a console terminal shell or command prompt. I am a bit surprised you were introduced to an IDE before a console!

Anybody else got different opinions?
 
Stevi Deter
Ranch Hand
Posts: 265
Hibernate Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to agree with you, Campbell. Everybody should have to write Hello World in a text editor and compile and run it from the command line. I wouldn't expect IDEs to be introduced until after the basics of the language are understood.

(insert crotchety comments about coding uphill in the snow in both directions here.)
 
Christopher Young
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.

How does the console winddow operate differently than say a GUI?

I mean is it something that took a lot of code to make or is it something that's just kind of "there"? if that makes sense?

I don't know why I was given an IDE first though. I did learn enough command line to run a program (sort of), when seeing how to make a .exe file out of Java using a third-party program and all that, so its not something that'd be too hard to learn and stuff.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47274
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Christopher Young:
How does the console window operate differently than say a GUI?
It is like chalk and cheese. The console is not part of Java, but part of the OS; if you are on Linux you will almost certainly have a terminal launching icon on your panels. If you are using command line you are probably on Windows and the window you write the command line instructions on represents the console.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JVM in fact doesn't know about the console at all. All it knows about are streams that are provided by the operating system. It's the responsibility of the OS to connect those streams to a console window - or to something else, as most operating systems allow those streams to be redirected. And some operating systems might not even support them at all.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic