IntelliJ IDEA has a function that can code in the cloud?

foreword

Since I used the genuine IntelliJ IDEA, it has basically kept pace with the times, and a new version will be updated immediately, which also allows me to experience the latest and fastest functions.

When I was browsing the official website of Jetbrains recently, I saw the 2021.3release of the latest EAP version. Immediately down to try.

And what excites me is that the 2021.3release adds a range of capabilities for developing in the cloud.

The so-called cloud development refers to running a light client locally. All code storage, code compilation, and code execution are done remotely. Local only for a display and editing role.

In this era, many things have been cloud-based, including cloud computers, cloud mobile phones, and cloud games. I have been looking forward to a cloud IDE, although I know that vscode is open source and has a corresponding cloud platform. But I said that IntelliJ IDEA is the ceiling of Java development IDE, no one should refute this.

This EAP version directly shows that IDEA can be used as both a local IDE and a light client to connect to the cloud, and use the powerful processing power of the cloud to speed up your code compilation and startup speed.

And this cloud can be automatically initialized by specifying a server, which is extremely convenient.

And this article, let's find out: how this idea cloud works.

one

After installing the version, there is one more option 2021.3 EAPon the welcome screen :Remote Development

Click Connect via SSH, you can see that you can connect to a remote server as a computing resource as long as you use SSH. Like all SSH, fill in your corresponding necessary authentication method, here I use the RSA private key authentication method:

After clicking Check Connection and Continue, all subsequent actions are automatically completed by IDEA. Including installing a remote service process on your server, initialization and other things. This process can only take a while.

I waited about 5 minutes for this process. After seeing the successful connection to the remote server, you can click on Project directoryit to see the file directory on the server, and choose one as your working directory.

At this time, the remote process on the server should have been enabled. I boarded the server and searched for the process of the idea. I can find that 4 processes are started on the remote server.

two

After connecting to the main interface, I found that there is no difference between the basic and local ones. Just an instant up and down speed indicator in the lower right corner. and a ping value. Children's shoes who have played mobile games should know what the concept of ping is. The lower the ping value, the lower the latency. As you can see from the figure below, the delay between my local and the server is 22ms. Children's shoes who have a little concept of this value should know that this ping value basically does not feel the delay.

Next, we will experience remote compilation.

I created a springboot web project, of course, all the code created is on the remote, and the local is just an editing interface.

When running mvn clean packagethe command, it should be noted that the maven command is not executed locally at this time, but is already at the remote end. The premise is that the remote server has installed maven and configured the system path.

The whole process is not much different from the local one. The time-consuming operation results are as follows, which includes the time to download springboot-related dependencies from the central warehouse + compile and package. Even I think it's faster than local.

By the way, when testing here, the configuration of the remote server is 8-core 64G memory.

Next I added a controller to the demo project. Run the project directly.

It runs very fast. The configured port number is 8989.

If we usually want to access the controller, we will definitely access 127.0.0.1:8989, but this operation is also run remotely.

I checked the remote process and port number, and indeed a thread is opened on the server, and the port number is 8989

Next, use the public network address of the server to access, and there is no problem.

Even the debug is exactly the same as the local one, there is no sense of violation

Basically, this can be done without deploying on the test environment. It is equivalent to deploying a test server. Not using local resources.

When other services are called, they can be debugged directly locally. No need to open remote debug yet.

Of course, the above is purely a personal joke, and the test environment deployment process is still needed. This is just to illustrate that this local mode-like debug is indeed more -Xrunjdwpthan a little better than the configuration-based remote debug.

Summarize

After the whole experience, it can be said that the operation mode is exactly the same as the local one, but the computing and storage resources are on the remote end. And in the process of my experience, there is basically no place that makes me feel stuck, it is as smooth and smooth as local.

Some children's shoes have low local configuration, and usually start to get stuck after opening a few IDEA windows, so they can use the company's high-performance server as the remote. Take advantage of the high performance of the server as a computing resource. There should be no lag if you open a dozen light clients locally. There is no need to change the computer, the god operation to solve the problem of idea stuck immediately.

Because this version is only an EAP version, the official document also said that there may be unstable exceptions during use. So I am still looking forward to the official version of 2021.3.

Maybe in the future, whether it is a mobile phone, a pad, or a computer with a lightweight configuration. As long as we open the light client of idea and connect to a powerful cloud server, whether it is compiling, starting, and loading, it is extremely fast. It won't appear again, it takes 20 minutes to compile and 10 minutes to start.

I am Bo Saidong, an open source author and content blogger, who loves life and sharing. If you are interested in my content, please retweet, like, and follow me.

{{o.name}}
{{m.name}}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324125721&siteId=291194637