IntelliJ IDEA + Tomcat of JavaEE configures JavaEE development environment

1. Download and install Tomcat:

1.1 Official download address: https://tomcat.apache.org/

Try to choose the exe program to install, the compressed package did not start up for the first time, and the tomcat11 version always prompts a version error, so I replaced it with the tomcat8 version and started smoothly

7888f783236b4a1a8ed3a839e7168a45.png

1.2, after the installation is complete, enter http://localhost:8080/ in the browser , and the tomcat welcome page appears, indicating that there is no problem

9d4c8a0402a64c56941fbd9970fc7198.png

1.3, the startup failure may be mainly due to environment variables and port occupation

Variable name: CATALINA_HOME

Variable value: Tomcat installation path

91d79ca0ae8547e48fc97c0349781cc5.png

20e9388bde1b4e8fb2f2527b37b0f46b.png

Port occupancy check, windows+R to bring up the command box, enter cmd into the terminal, enter netstat -ano|findstr 8080, if it is occupied, replace it with 8081 or other, restart the tomcatf service, and try again http://localhost:8081/

50a4abdeb1874a37b9101bb00a60fed8.png

 Two, IntelliJ IDEA configuration

2.1 New project

533b13ac48d94381a7e75de126ae9e93.png

 c33f6ac33bf74d468babf17118a3efeb.png

52404c8606f24f0bbaacdd93732ba014.png

2.2, add javaEE framework support

b08b45f2808847ddacbb4c3beb331c47.png

6681bb344c0d4e4cbee87a297add295b.png

 2.3 We found that there is no javaee module in the framework. There are two situations. One is the downloaded community version, which does not support JavaEE module. The second is that it is already an official version or there is no JavaEE. At this time, you need to add the registry of the javaee module. Shortcut keys Ctrl + Shift + Alt + /

db6eb36e103644c08cebd2053e293df2.png

5d076b3d4df542b9b3d184f7651f8ebd.png

 0f338fc501c5446b8ba5027c21c25d81.png

Three, run

3.1, error:

Error:Internal error: (java.lang.IllegalAccessError) class com.intellij.util.io.FileChannelUtil (in unnamed module @0x4387b79e) cannot access class sun.nio.ch.FileChannelImpl (in module java.base) because module java.base does not export sun.nio.ch to unnamed module @0x4387b79e
java.lang.IllegalAccessError: class com.intellij.util.io.FileChannelUtil (in unnamed module @0x4387b79e) cannot access class sun.nio.ch.FileChannelImpl (in module java.base) because module java.base does not export sun.nio.ch to unnamed module @0x4387b79e
	at com.intellij.util.io.FileChannelUtil.setupUnInterruptibleHandle(FileChannelUtil.java:26)
	at com.intellij.util.io.FileChannelUtil.<clinit>(FileChannelUtil.java:18)
	at com.intellij.util.io.ReadWriteDirectBufferWrapper$FileContext$1.execute(ReadWriteDirectBufferWrapper.java:50)
	at com.intellij.util.io.ReadWriteDirectBufferWrapper$FileContext$1.execute(ReadWriteDirectBufferWrapper.java:42)
	at com.intellij.openapi.util.io.FileUtilRt.doIOOperation(FileUtilRt.java:945)
	at com.intellij.util.io.ReadWriteDirectBufferWrapper$FileContext.<init>(ReadWriteDirectBufferWrapper.java:42)
	at com.intellij.util.io.ReadWriteDirectBufferWrapper.create(ReadWriteDirectBufferWrapper.java:27)
	at com.intellij.util.io.DirectBufferWrapper.getBuffer(DirectBufferWrapper.java:24)
	at com.intellij.util.io.ReadWriteDirectBufferWrapper.getBuffer(ReadWriteDirectBufferWrapper.java:16)
	at com.intellij.util.io.PagedFileStorage$StorageLock.createValue(PagedFileStorage.java:631)
	at com.intellij.util.io.PagedFileStorage$StorageLock.get(PagedFileStorage.java:558)
	at com.intellij.util.io.PagedFileStorage$StorageLock.access$500(PagedFileStorage.java:466)
	at com.intellij.util.io.PagedFileStorage.getBufferWrapper(PagedFileStorage.java:407)
	at com.intellij.util.io.PagedFileStorage.getBuffer(PagedFileStorage.java:371)
	at com.intellij.util.io.PagedFileStorage.put(PagedFileStorage.java:278)
	at com.intellij.util.io.PagedFileStorage.fillWithZeros(PagedFileStorage.java:356)
	at com.intellij.util.io.PagedFileStorage.resize(PagedFileStorage.java:330)
	at com.intellij.util.io.ResizeableMappedFile.expand(ResizeableMappedFile.java:108)
	at com.intellij.util.io.ResizeableMappedFile.ensureSize(ResizeableMappedFile.java:77)
	at com.intellij.util.io.ResizeableMappedFile.putInt(ResizeableMappedFile.java:221)
	at com.intellij.util.io.PersistentEnumeratorBase.markDirty(PersistentEnumeratorBase.java:597)
	at com.intellij.util.io.PersistentEnumeratorBase.<init>(PersistentEnumeratorBase.java:185)
	at com.intellij.util.io.PersistentBTreeEnumerator.<init>(PersistentBTreeEnumerator.java:73)
	at com.intellij.util.io.PersistentEnumeratorDelegate.<init>(PersistentEnumeratorDelegate.java:47)
	at com.intellij.util.io.PersistentHashMap.<init>(PersistentHashMap.java:149)
	at com.intellij.util.io.PersistentHashMap.<init>(PersistentHashMap.java:138)
	at com.intellij.util.io.PersistentHashMap.<init>(PersistentHashMap.java:129)
	at com.intellij.util.io.PersistentHashMap.<init>(PersistentHashMap.java:121)
	at com.intellij.util.io.PersistentHashMap.<init>(PersistentHashMap.java:114)
	at org.jetbrains.jps.incremental.storage.AbstractStateStorage.createMap(AbstractStateStorage.java:124)
	at org.jetbrains.jps.incremental.storage.AbstractStateStorage.<init>(AbstractStateStorage.java:27)
	at org.jetbrains.jps.incremental.storage.FileTimestampStorage.<init>(FileTimestampStorage.java:27)
	at org.jetbrains.jps.incremental.storage.ProjectStamps.<init>(ProjectStamps.java:39)
	at org.jetbrains.jps.incremental.storage.ProjectTimestamps.<init>(ProjectTimestamps.java:19)
	at org.jetbrains.jps.cmdline.BuildRunner.load(BuildRunner.java:92)
	at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:274)
	at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:130)
	at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:232)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1589)

This is caused by the JDK version is too high, modify the JDK version in the project configuration

98971e54e7b340e1acfca1eace49f817.png

3.2, tomcat configuration error

Error running ‘Tomcat 8.5.45‘ port out of range-1

40fab8e493b84472803405ecb3c0346f.png

 Open the tomcat installation directory, server.xml in the config directory, and change the port from the original -1 to 8005.

3.3 Port occupation960f63834e3346f2804570443dd99638.png

fe2724509a7a45a2b251d39eb9675c02.png

 Open the editor tomcat configuration, change the port 8080 to 8081, and run it again to open the webpage normally

Four editors extend the validity period

4.1 Official website IntelliJ IDEA download link: https://www.jetbrains.com/idea/download/

4.2 Download extension tool: Link: https://pan.baidu.com/s/1ycx9KkhTLtdqvT-0TQ67-A  Extraction code: haha

4.3 Double-click reset_jetbrains_eval_windows.vbs to execute the script directly, just wait for the execution to complete

4.4 Plug-in patch use, drag ide-eval-resetter-2.1.6.zip into IDEA interface

a76fdacf7db7a4baf8f33a57218b0739.png

Or you can  manually install the plugin in Settings/Preferences... ->  ( )PluginsInstall Plugin From Disk...

380444e11c144a5eb8e2e03f890d6460.png

4.5 use

If the IDE does not open the project, click the menu on the Welcome interface: Get Help -> Eval Reset
If the IDE opens the project, click the menu: Help -> Eval Reset 

2d329e9469384129bc1fa96468db87fa.png

Button: Reload is used to refresh the displayed information on the interface, including the time when the 30-day trial period was last reset.
Button: Reset Clicking will ask whether to reset the trial for 30 days and restart the IDE. Select Yes to execute the reset operation and restart the IDE to take effect, select No to do nothing 

 It can also be updated automatically, check Auto reset before per restart, and the trial information will be automatically reset every time you restart/exit the IDE

63adeb1725484d1d87d2d5c23f5c7472.png

 4.6 You can see that before the update is April 11, 2023

d87cae5bbf404801a572b8711e77f061.png

After the update is April 28, 2023, which is 30 days from today

d9a0522569a7406fa07dfd79343c9cf1.png

Guess you like

Origin blog.csdn.net/qq_29848853/article/details/129393440