eclipse applet||eclipse switch low version JDK to realize JavaAPPlet

Here are a few methods I have tried

Method 1: Add dynamic web project to existing eclipse

This method also has two different implementations:

Law 1.1 online download

insert image description here
Find your own version number, then enter it, you can find the relevant one, double-click to enter
(I installed 2022-06 myself, so I just enter 2 and it will pop up automatically, in fact, everyoneNo need to check your own version number, just enter 2 and your own version will pop up)
insert image description here
Scroll down and find web, html, java EE. . . Select this and click next
insert image description here
and wait for the installation. I
don’t know why, but it was very slow when I downloaded it, so I gave up before the download was complete.

So whether this method is useful or not, I can't judge

Method 1.2 Install after downloading the webpage
Click on the link: jump to the official website of eclipse and find your own version
Click Download Packages
insert image description here
to find web developers and download the version that suits you (I am Windows, so click the first one)

insert image description here
Just jump to this page to download it, but
insert image description here
when I was halfway through the download, I suddenly found out that this is a new version of eclipse-JEE (I installed eclipse-JSE before).
I was confused

I can't say that this method is useless, because this software is indeed used later (although it has nothing to do with my original intention)

(I will talk about how to apply it later)

Method 2 Install the eclipse-JEE mentioned above

This download step has already mentioned a method, you can go back to method 1.
After the installation, I can’t wait to create a new program, but it turns out that there is still the same error.
I am frustrated because I can’t find the applet class, thinking about installing it. The lower version of JDK, I
turned around and saw an article, saying that it is possible to create small applications through JSP files
(later found out that it is realized by borrowing a browser).
Let me talk about the steps in a shallow way.

file -->new–>other

insert image description here

Select Dynamic web Project under web —>nextinsert image description here

Do not finish, choose next

insert image description here

nextinsert image description here

insert image description here

Then find the main----webapp in SRC

insert image description here
Then right-click the webapp to create a new JSP file (must be in this folder)
insert image description here

Then you can modify the html file in this (the premise is that Tomcat is configured, this is how you install Baidu yourself, if I can remember it later, I will add it here. Remarks: I am not lazy)

accomplish

Prerequisite work: Download Jdk8 and below (the applet has been deprecated after JDK9).
After downloading, there is no need to reconfigure the environment variables. You can directly reference the two JDKs.
The details are as follows:

window—>preferences

insert image description here

java—>installed JREs---->Add

insert image description here

standard VM---->next

insert image description here

Directory----->Choose the folder of the lower version of jdk installed by yourself

insert image description here

After the selection, you can automatically jump out of the content in the picture below ----->next

(Because I've done it before, I can't click next here)
insert image description here

Next, you can create a new low-level java project.

Switch the JRE here to the version you just configured

insert image description here

The next step is to create a new class and write the applet program in it normally

After running, you will find garbled characters

insert image description here
This is because the applet uses GBK, and our eclipse uses utf-8,
so we have to switch

As shown in the picture, I am utf-8 here, just replace it with GBK

insert image description here

Switch the encoding format in the project as shown below:

Right-click the project---->properties
insert image description here
resource----->text file encoding
insert image description here
and then run the program again and you will find that it is normal

Guess you like

Origin blog.csdn.net/m0_67522355/article/details/126842845