Problem with System.out.prinln( "" ) on windows.

J

Joe Vasher

I wrote a program that creates/loads a file that I wrote with netbeans
3.6 on linux, i moved it to my windows machine and tried it out it does
everything except System.out.println(); in the cli on windows. Is this a
problem with windows. or do I have to do special handling of output on
windows. It works fine onn linux its in a jar file which I can execute
on linux no problems.
 
J

Joe Vasher

Andrew said:
I wrote a program that creates/loads a file that I wrote with netbeans
3.6 on linux, i moved it to my windows machine and tried it out it does
everything except System.out.println(); in the cli on windows.


Have you created a jar file?
Does it have a manifest?
[ Please note I originally read that into
your post and the entire answer assumes
that is the case. No jar - no relevance. ]

Do you actually *get* a console?

..Is this a
problem with windows.


I suspect it is more a problem of not
reading the documentaion..

Check the last paragraph of..
<http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/java.html#description>
This relates to 'java', the default
(AFAIU) for a jar with manifest, if
you launch it using a batch file and
the 'java' command, you should be
getting a console (with output).

..or do I have to do special handling of output on
windows. It works fine onn linux its in a jar file which I can execute
on linux no problems.


Do you get a console as default on Linux?
(shrugs) I use XP.

I'm using windows 2000, I was running the program with java class name.
I do have the proper main-class in the manifest, It works fine on linux
it actaully works fine on windows. except for System.out.println()
doesn't display the messages. The class preforms proper io and loading
of Hashtable. which I can tell from the directorys and file it created.
 
J

Joe Vasher

Joe said:
Andrew said:
I wrote a program that creates/loads a file that I wrote with
netbeans 3.6 on linux, i moved it to my windows machine and tried it
out it does
everything except System.out.println(); in the cli on windows.



Have you created a jar file? Does it have a manifest?
[ Please note I originally read that into
your post and the entire answer assumes that is the case. No jar - no
relevance. ]

Do you actually *get* a console?

..Is this a problem with windows.



I suspect it is more a problem of not reading the documentaion..

Check the last paragraph of..
<http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/java.html#description>

This relates to 'java', the default
(AFAIU) for a jar with manifest, if
you launch it using a batch file and
the 'java' command, you should be getting a console (with output).

..or do I have to do special handling of output on windows. It works
fine onn linux its in a jar file which I can execute on linux no
problems.



Do you get a console as default on Linux?
(shrugs) I use XP.

I'm using windows 2000, I was running the program with java class name.
I do have the proper main-class in the manifest, It works fine on linux
it actaully works fine on windows. except for System.out.println()
doesn't display the messages. The class preforms proper io and loading
of Hashtable. which I can tell from the directorys and file it created.

well went back to play with it. I ran it with java -jar in cli it worked
fine. Thought I tried that.
 
A

Andrew Thompson

I wrote a program that creates/loads a file that I wrote with netbeans
3.6 on linux, i moved it to my windows machine and tried it out it does
everything except System.out.println(); in the cli on windows.

Have you created a jar file?
Does it have a manifest?
[ Please note I originally read that into
your post and the entire answer assumes
that is the case. No jar - no relevance. ]

Do you actually *get* a console?
..Is this a
problem with windows.

I suspect it is more a problem of not
reading the documentaion..

Check the last paragraph of..
<http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/java.html#description>
This relates to 'java', the default
(AFAIU) for a jar with manifest, if
you launch it using a batch file and
the 'java' command, you should be
getting a console (with output).
..or do I have to do special handling of output on
windows. It works fine onn linux its in a jar file which I can execute
on linux no problems.

Do you get a console as default on Linux?
(shrugs) I use XP.
 
A

Andrew Thompson

On Wed, 12 May 2004 09:22:29 -0400, Joe Vasher wrote:

well went back..

In time?
..to play with it. I ran it with java -jar in cli it worked
fine.
Great!

..Thought I tried that.

Maybe you did, ..tomorrow.

Your reply to my first post was made
approximately 11 hours before my post.

This time travel stuff is confusing! ;-)
 
C

Chris Smith

Joe said:
well went back to play with it. I ran it with java -jar in cli it worked
fine. Thought I tried that.

Joe,

Executable JARs are associated by default with the javaw.exe application
in Windows. That application is a version of the interpreter that
doesn't attach itself to a console. If you need a console, you'll need
to run the app explicitly using "java -jar".

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
J

Joe Vasher

Chris said:
Joe,

Executable JARs are associated by default with the javaw.exe application
in Windows. That application is a version of the interpreter that
doesn't attach itself to a console. If you need a console, you'll need
to run the app explicitly using "java -jar".


I was running it in the console (cli) but for some stupid reason i
didn't do the java -jar <jarfile.jar> option but it works great..

Thanks for help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top