File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Java Install Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java Install Question" Watch "Java Install Question" New topic
Author

Java Install Question

Donald Wedding
Ranch Hand

Joined: Aug 28, 2001
Posts: 72
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

Joined: Dec 10, 2001
Posts: 7023
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?


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Donald Wedding
Ranch Hand

Joined: Aug 28, 2001
Posts: 72
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

Joined: Dec 10, 2001
Posts: 7023
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

Joined: Aug 28, 2001
Posts: 72
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

Joined: Jun 18, 2002
Posts: 29
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

Joined: May 10, 2001
Posts: 265
I just ran your code on 2000 and it works.
(The window is pretty small in the top left hand corner.)
Stuart Poss
Greenhorn

Joined: Jan 10, 2003
Posts: 5
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

Joined: Dec 10, 2001
Posts: 7023
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

Joined: Aug 28, 2001
Posts: 72
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

Joined: Aug 28, 2001
Posts: 72
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.
 
wood burning stoves
 
subject: Java Install Question
 
Similar Threads
Class and or path confusion.
NoClassDefFoundError
catlle drive oop-1 to 4
Java JDK Installation Problem - Need Help!
Exception in thread "main" java.