Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Install Question

 
Donald Wedding
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Help!
I have a new computer with WINDOWS 2000
I just downloaded and installed j2sdk1.4.1_01
I've been away from Java for a while, but near as I can tell, I don't need to have a CLASSPATH to use Swing (am I wrong?).
When a run a simple "Hello World" program, everything is fine.
When I try to run a simple JFrame program with an exit button, then my program hangs. A friend of mine running j2sdk1.4.1_01 on NT 4 has no problems (he also has no CLASSPATH set).
Is there a problem with Windows 2000 that I don't know about?
Help! Please! I'm having Java withdrawls !!!
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I doubt your problem is related to a CLASSPATH setting. As you suggested, you don't need a CLASSPATH environment variable for Sun's 1.4 Java compiler and runtime environment to be able to locate the J2SE API libraries.
I would be sure to specify the location of Sun's JRE in the PATH setting before the location of any Microsoft counterpart could be located. I doubt this relates to your current problem, though it might.
I'm not aware of any issues with Windows 2000 that might be a source of your troubles.
What's the code that you're using? Could you more fully describe the 'hanging' experience?
 
Donald Wedding
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my path ... (or at least part of it )
Path=C:\java\j2sdk1.4.1_01\bin;C:\java\j2sdk1.4.1_01\jre\bin; etc.
The java stuff is FIRST in my path. I have all of my java stuff hanging off of a "java" directory.
Here is my program ....

When I run this from the command line( C : ) Prompt ,
it looks like this...
== == == == == == == == == == == ==
c:java Deck
x
== == == == == == == == == == == ==
Assume that the "x"is a blinking curser
which implies that my program is running.
[ edited to preserve formatting using the [code] and [/code] UBB tags -ds ]
[ January 10, 2003: Message edited by: Dirk Schreckmann ]
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course, in your posted code, the button doesn't do anything (as no ActionListener is listening to it).
Did you really intend to define a class that both is a JFrame and has a JFrame?
When you say that the program hangs after closing the JFrame, I'll guess that you mean that the Java program keeps running (with only a console displayed) though the frame has disappeared. Take a look at The JFrame Class Documentation. Notice the setDefaultCloseOperation(int) method. Getting any ideas?
Also, note that you don't have to import any class from the java.lang package, as this package is automatically imported.
 
Donald Wedding
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JFrame never even pops up.
I just type
"java Deck"
then I hit the <CR>
then it just sits there. No window pops up. No nothing! I figured it had something to do with no swing in my class path but I don't think that's the problem with this because this version doesn't require swing in the classpath.
 
Ken Cobbs
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works fine on Windows ME. The exit button doesn't do anything and if you close the window you still have to do a control-c to stop the program. But, the tiny little window with the exit button shows up on my PC.
 
Chad McGowan
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just ran your code on 2000 and it works.
(The window is pretty small in the top left hand corner.)
 
Stuart Poss
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tried your source code. I'm running Java 1.4.1_01 on Mandrake 9.0.
It worked fine, although as a previous coder pointed out you didn't code for an action listener so the button doesn't do anything.
I've found Eckstein, Loy, and Wood (O'Reilly's version of Java Swing) a useful with regard to JFrame. You might want to check it or a similar volume out.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Donald, this is not a CLASSPATH problem. If I were you, I'd probably try to uninstall all JREs and JDKs, restart the computer, then reinstall.
What happens with a regular ol' AWT frame program such as the following?
 
Donald Wedding
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nope. The AWT code didn't work either. I am getting more and more convinced that this is a bug with Windows 2000.
Anybody heard any bugs that might cause these problems?
 
Donald Wedding
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I called the "help desk" here at work and they were stumped.
Tech Support finally had me reinstall "SERVICE PACK 2" for Microsoft Windows 2000.
Now it works!
Therefore, I must have had a corrupted install file. Hope that helps others in my situation!
By the way, Microsoft has Service Pack 3 out, but our company hasn't officially tested that yet, so they didn't want me to upgrade.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic