Well, I posted this identical problem on a SUN forum but no reply yet. Here it is: I have J2SDK; it's installed and I'm using it every day to write beginner Java applications. BUT I can't run applets in my browser (I'm using Windows XP with IE 5) or even from the DOS prompt with the "appletviewer" command. When I type: appletviewer appletname.html I get the message: 'appletviewer' is not recognised as an internal or external command, operable program or batch file. So I followed the link to GET IT NOW on www.java.com/en/index.jsp and it did the "Checking configuration" thing for an automatic download and left me with the Exception: Applet com.sun.java.Main notinited Great, so they want my system to use an applet to install the software required to run applets(!?@#*?) So I tried the manual download and see that it's just JRE, which I have a recent copy of anyway. I know it works because I use it applications; it just won't work for applets. And since I've re-downloaded and reinstalled it a couple of times there's definitely not something wrong with the download file. I am getting very irritated since I've been trying to sort this out for several weeks now. To add to this, it's not just my home pc that has this problem, but my one at work too (Windows 2000)!
Does this problem also happens with netscape/mozilla browsers? First of all, update ie 5 to ie 6 and download and install http://ftp.yars.free.net/pub/software/java/j2sdk-1_4_2-windows-i586.exe (The same file on sun servers is dammaged) Go to control panel, click on java plugin, and set it as the jre for all the browsers you want (IE,netscape...) In XP , set PATH correctly to point to j2sdk1.4.2\bin directory by clicking start-> Control Panel -> System -> Advanced Options -> variables , (or something like that). set CLASSPATH if you want (i recommend adding "\." to CLASSPATH) After that , open cmd.exe and try running appletviewer with the html file you want. You can also try running some of the applets listed here : http://www.reed.edu/~mcphailb/applets/
posted 17 years ago
Thanks Matthew, I don't have any other browsers loaded and am not about to try do download any now. My line is pretty slow, so I can't just download others or the latest SDK from home though can do so from work next week. (But will it help? I'm on j2sdk1.4.1_01 already.) My home pc is on IE6 not 5 as I said by mistake (my work one is ie5). I've set the path correctly now and added \. to the classpath list, but still get the "notinited"/applet not initialised exception. Any more ideas? Much appreciated, DW
posted 17 years ago
well, you don't need j2sdk1.4.2, but it could be a problem with the java installation (perhaps corrupted jars),however the sdk you've got looks good.Did you tried changing java plugin to be set as ie jre? Because i got a lot of strange problems like yours with the crapy Virtual machine from Microsoft , until i used java plugin. Sorry, no new ideas for the moment...