Jessica Hope

Greenhorn
+ Follow
since Dec 04, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Jessica Hope

Okay... many thanks, Eshwar and Ulf. There's lots of good information in that link, Eshwar, and I appreciate your explanation of "appletviewer," Ulf.

Cheers!
[ December 06, 2008: Message edited by: Jessica Hope ]
15 years ago
Hi, all! I'm very new here and to Java, but I've had good success so far. This seems like a good place.

Anyhow, my question is whether there is a way to run an applet from the command line or whether you have to embed the applet onto an HTML web page to run it. Obviously, the usual "java Foo" doesn't work for an applet, because it tries to call main and there may not be main in an applet (if I understand correctly).

I know that there is such a thing as "appletviewer," but I don't think I understand what that is or how it works.

To extend things a bit, I'd also appreciate a basic overview of which Java web technologies do what. I know that there are applets, servlets, JSP, Java Web Start, etc. Once one knows the lay of the land I'm sure the distinctions are obvious and clear, but when one is just starting out it's hard to know what each of these different technologies are, what they do, and in what situations one would use each.

Thanks in advance!
[ December 05, 2008: Message edited by: Jessica Hope ]
15 years ago
For what it's worth, your Chico Invaders wouldn't launch for me. I got an "Application Error" which stated "Unable to launch application."

So sorry about that...
15 years ago
Okay, lovely... I now have it working. Thanks, all, for your help. I plan to continue to be on the forum as I move forward in my Java journey.

I appreciate all the input greatly!
15 years ago
Hi, all! Thanks for your input. Where would you suggest that I store my .java files? Would the C:\Program Files\Java directory be an appropriate place?

Also, the HelloWorldApp.java file comes straight from the Sun "Getting Started" tutorial.

This is the code for the file:


At this point should I move the HelloWorldApp.java file to a different directory and try compiling a .class file? That's what your post seems to suggest, but I'm a newbie, so...

Thanks again!
15 years ago
Hi, Mike! Thanks for the reply. Yes, I neglected to mention that I'm on a Windows machine running Vista. I have actually successfully written, compiled, and run Java programs with JCreator, but decided I wanted to do it from the command line instead. That's when all the trouble started!

At the command line, first I head to the directory where my HelloWorldApp.java file is. That directory is c:\PROGRA~1\Java\jk1.6.0_11. When I then do a directory listing ("dir"), here is what shows up:

12/04/2008 09:22 PM <DIR> .
12/04/2008 09:22 PM <DIR> ..
12/01/2008 11:19 PM <DIR> bin
11/10/2008 06:16 AM 3,841 COPYRIGHT
12/01/2008 11:24 PM <DIR> demo
12/02/2008 12:42 AM <DIR> docs
12/04/2008 09:22 PM 1,908 HelloWorldApp.java
12/01/2008 11:19 PM <DIR> include
12/01/2008 11:21 PM <DIR> jre
12/01/2008 11:22 PM <DIR> lib
12/01/2008 11:19 PM 17,400 LICENSE
12/01/2008 11:19 PM 17,496 LICENSE.rtf
12/01/2008 11:19 PM 29,318 README.html
12/01/2008 11:19 PM 25,828 README_ja.html
12/01/2008 11:19 PM 21,275 README_zh_CN.html
12/01/2008 11:40 PM 5,305 register.html
12/01/2008 11:40 PM 5,724 register_ja.html
12/01/2008 11:40 PM 4,902 register_zh_CN.html
12/01/2008 11:24 PM <DIR> sample
11/10/2008 06:17 AM 19,621,235 src.zip
12/01/2008 11:19 PM 231,168 THIRDPARTYLICENSEREADME.txt
12 File(s) 19,985,400 bytes
9 Dir(s) 5,020,598,272 bytes free

Next, I enter "javac HelloWorldApp.java" and hit enter. Things whirr and hum and I get no error message. Then I type the "dir" command again, and find that, alas, the HelloWorldApp.class file that I had so been hoping to see is not there. As far as I can tell, the contents of the directory are precisely the same as before the "javac" command.

Here's a transcript of the entire session:

C:\Users\Jessica>cd c:\progra~1\java\jdk1.6.0_11

c:\PROGRA~1\Java\jdk1.6.0_11>dir
Volume in drive C is SQ004286V02
Volume Serial Number is CE35-D374

Directory of c:\PROGRA~1\Java\jdk1.6.0_11

12/04/2008 09:22 PM <DIR> .
12/04/2008 09:22 PM <DIR> ..
12/01/2008 11:19 PM <DIR> bin
11/10/2008 06:16 AM 3,841 COPYRIGHT
12/01/2008 11:24 PM <DIR> demo
12/02/2008 12:42 AM <DIR> docs
12/04/2008 09:22 PM 1,908 HelloWorldApp.java
12/01/2008 11:19 PM <DIR> include
12/01/2008 11:21 PM <DIR> jre
12/01/2008 11:22 PM <DIR> lib
12/01/2008 11:19 PM 17,400 LICENSE
12/01/2008 11:19 PM 17,496 LICENSE.rtf
12/01/2008 11:19 PM 29,318 README.html
12/01/2008 11:19 PM 25,828 README_ja.html
12/01/2008 11:19 PM 21,275 README_zh_CN.html
12/01/2008 11:40 PM 5,305 register.html
12/01/2008 11:40 PM 5,724 register_ja.html
12/01/2008 11:40 PM 4,902 register_zh_CN.html
12/01/2008 11:24 PM <DIR> sample
11/10/2008 06:17 AM 19,621,235 src.zip
12/01/2008 11:19 PM 231,168 THIRDPARTYLICENSEREADME.txt
12 File(s) 19,985,400 bytes
9 Dir(s) 5,020,598,272 bytes free

c:\PROGRA~1\Java\jdk1.6.0_11>javac HelloWorldApp.java

c:\PROGRA~1\Java\jdk1.6.0_11>dir
Volume in drive C is SQ004286V02
Volume Serial Number is CE35-D374

Directory of c:\PROGRA~1\Java\jdk1.6.0_11

12/04/2008 09:22 PM <DIR> .
12/04/2008 09:22 PM <DIR> ..
12/01/2008 11:19 PM <DIR> bin
11/10/2008 06:16 AM 3,841 COPYRIGHT
12/01/2008 11:24 PM <DIR> demo
12/02/2008 12:42 AM <DIR> docs
12/04/2008 09:22 PM 1,908 HelloWorldApp.java
12/01/2008 11:19 PM <DIR> include
12/01/2008 11:21 PM <DIR> jre
12/01/2008 11:22 PM <DIR> lib
12/01/2008 11:19 PM 17,400 LICENSE
12/01/2008 11:19 PM 17,496 LICENSE.rtf
12/01/2008 11:19 PM 29,318 README.html
12/01/2008 11:19 PM 25,828 README_ja.html
12/01/2008 11:19 PM 21,275 README_zh_CN.html
12/01/2008 11:40 PM 5,305 register.html
12/01/2008 11:40 PM 5,724 register_ja.html
12/01/2008 11:40 PM 4,902 register_zh_CN.html
12/01/2008 11:24 PM <DIR> sample
11/10/2008 06:17 AM 19,621,235 src.zip
12/01/2008 11:19 PM 231,168 THIRDPARTYLICENSEREADME.txt
12 File(s) 19,985,400 bytes
9 Dir(s) 5,020,561,408 bytes free

c:\PROGRA~1\Java\jdk1.6.0_11> // Bummer... no class file!


I hope that provides you with some more detail on the problem, and I thank you very much for your help!
15 years ago
Hi, all! I'm trying to compile from the command line for the first time. I can compile fine (ie., without an error message), but I don't see any nice HelloWorldApp.class file appearing in my directory.

I understand this is a common issue. I've read the threads here and have implemented the steps at Sun's link: http://java.sun.com/javase/6/webnotes/install/jdk/install-windows.html#Environment. Still no luck...

Any suggestions?

Thanks in advance!

Oh...

PATH is set to C:\Program Files\Java\jdk1.6.0_11\bin
CLASSPATH is set to .;

[ December 04, 2008: Message edited by: Jessica Hope ]
[ December 04, 2008: Message edited by: Jessica Hope ]
15 years ago