Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

No console window when running manifest file?

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Marshal
Posts: 75690
354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 265
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Marshal
Posts: 75690
354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic