About some of my efforts with JAVA applets
- Here are a few methods I have tried
-
- Method 1: Add dynamic web project to existing eclipse
- Law 1.1 online download
- Method 2 Install the eclipse-JEE mentioned above
-
- file -->new-->other
- Select Dynamic web Project under web --->next![Insert picture description here](https://img-blog.csdnimg.cn/4aed832f07bf4a89a21ce67a94791c27.png)
- Do not finish, choose next
- next![Insert picture description here](https://img-blog.csdnimg.cn/470960dad8794db896dcb8d3b287a1dc.png)
- Then find the main----webapp in SRC
- accomplish
-
- window--->preferences
- java--->installed JREs---->Add
- standard VM---->next
- Directory----->Choose the folder of the lower version of jdk installed by yourself
- After the selection, you can automatically jump out of the content in the picture below ----->next
- Next, you can create a new low-level java project.
- The next step is to create a new class and write the applet program in it normally
- After running, you will find garbled characters
- As shown in the picture, I am utf-8 here, just replace it with GBK
- Switch the encoding format in the project as shown below:
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
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)
Scroll down and find web, html, java EE. . . Select this and click next
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
to find web developers and download the version that suits you (I am Windows, so click the first one)
Just jump to this page to download it, but
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
Select Dynamic web Project under web —>next
Do not finish, choose next
next
Then find the main----webapp in SRC
Then right-click the webapp to create a new JSP file (must be in this folder)
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
java—>installed JREs---->Add
standard VM---->next
Directory----->Choose the folder of the lower version of jdk installed by yourself
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)
Next, you can create a new low-level java project.
Switch the JRE here to the version you just configured
The next step is to create a new class and write the applet program in it normally
After running, you will find garbled characters
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
Switch the encoding format in the project as shown below:
Right-click the project---->properties
resource----->text file encoding
and then run the program again and you will find that it is normal