Results 1 to 6 of 6
- 03-20-2011, 03:04 PM #1
Member
- Join Date
- Mar 2011
- Posts
- 3
- Rep Power
- 0
Brand new to java ... window is closing
Hello,
I am brand new to java (jdk 6.0_24 installed, running Windows XP), and using BlueJ (3.0.4) as my editor/compiler. I've tried a couple different programs from a book I am using (Sams Teach Yourself Java 6), and I think they may be running. They compile just fine, and I am getting files with .java extensions. When I run the programs, a command window opens, which I would expect, but then it closes immediately, so I can't see any of the output.
When I was learning C++, I figured out that I could add a variable and create a cin<< statement to that variable at the end of my program, leaving the window open until I entered that variable. But I don't know enough java at this point to try that, if that would even solve my issue.
Any help here would be appreicated.
- 03-20-2011, 04:07 PM #2
Member
- Join Date
- Mar 2011
- Posts
- 3
- Rep Power
- 0
Okay, so I can sort of get things to work, but I suspect there things I could (should?) do differently.
Within BlueJ, I am able to call the Main method, and it runs in the BlueJ Terminal Window. So I know that the code is correct. (Small yeh)
I looked around the other threads here, and found this one (My first java program could not be executed..help), and so I tried to run my program from a cmd entry. Having the same issue miaaa00 had, I tried running my program using sunde887's suggestion (java -cp . ProgramName, and that worked. The program ran in the command window correctly. (Another small yeh)
Is there something in either my classpath or class setting that I need to adjust? Is there a way to run this from WE as opposed to in either the IDE or a cmd window?
classpath: C:\Program Files\Java\jdk1.6.0_24\lib\tools.jar
path: C:\Program Files\Java\jdk1.6.0_24\bin
directory: C:\Documents and Settings\Andrew\My Documents\Programs\Java\Week 1 (this has the .java files, .class files, and .ctxt files)Last edited by drw4d; 03-20-2011 at 04:36 PM.
- 03-20-2011, 04:27 PM #3
Member
- Join Date
- Mar 2011
- Location
- chennai
- Posts
- 55
- Rep Power
- 0
Bluej
sorry to say this,
I worked on your query but the window is not disappears to me. why don't you try again. if the problem still occurs send me the entire program code. and one thing have you set the PATH variable?
- 03-20-2011, 05:27 PM #4
You save the source code to a file with a .java extension. The .java file is compiled to one or more .class files.They compile just fine, and I am getting files with .java extensions.
What's 'WE'?Is there a way to run this from WE
What does that have to do with the stated problem? (Answer: nothing)have you set the PATH variable?
db
- 03-20-2011, 05:41 PM #5
Member
- Join Date
- Mar 2011
- Location
- chennai
- Posts
- 55
- Rep Power
- 0
i didnt get you could you tell me in clear manner.
- 03-20-2011, 05:48 PM #6
Member
- Join Date
- Mar 2011
- Location
- chennai
- Posts
- 55
- Rep Power
- 0
Similar Threads
-
How can I update something in Java without closing it out?
By rajkobie in forum New To JavaReplies: 6Last Post: 11-19-2010, 06:41 AM -
BRAND new to Java (editor question)
By hayden06f4i in forum New To JavaReplies: 2Last Post: 10-20-2010, 10:11 PM -
how can we call Logout servlet by closing window
By nagesh1811 in forum Java ServletReplies: 2Last Post: 07-11-2008, 07:41 AM -
Brand New to Java needs directions
By NatasjaA in forum New To JavaReplies: 13Last Post: 04-07-2008, 04:34 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks