idea remote development java

background

Recently, I am using Java to develop audio operation functions. I need to use jave2, but I finally found that the M1 chip is not supported, so I plan to study remote development. On the one hand, it can solve the problem that the development computer does not support it, and it can also reduce the pressure on the development computer and reduce environmental problems. bug.

selection

Starting from idea2021.1, it provides wsl2, ssh and docker. Through my own test, I found that ssh is the most practical, fast, and easy to debug. Basically, the same effect as local development can be achieved.

environment

The network environment is connected and can access each other. Install idea (latest version) and a linux server on the development computer.

Install

  1. linux install java environment
yum install java-1.8.0-openjdk* 	 	#安装openjdk
java -version 										#java版本查看
ls -lrt /usr/bin/java
ls -lrt /etc/alternatives/java				#找到jdk实际地址

insert image description here
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64 is the actual address of jdk, which will be used later

  1. Idea adds the ssh connection of the server,
    adds ssh configuration in idea,
    insert image description here
    and the test connection passes
  2. Configuration
    Click to edit configuration
    insert image description here
    and click to manage target
    insert image description here
    insert image description here
    . Note that rsync synchronization is selected here, so that it is not necessary to synchronize all each time during the development process. Installation method:
yum -y install rsync
systemctl start rsyncd.service
systemctl enable rsyncd.service
  1. Debugging
    Click Finish to start running debugging. If the server performance is high, the debugging process is smoother than local debugging.

If the front-end environment is set up on the server, all development and debugging can be completed on the server.

Supongo que te gusta

Origin blog.csdn.net/zhijiesmile/article/details/119914543
Recomendado
Clasificación