如何保存和运行在腻子Java文件? [英] How to save and run a Java file in PuTTY?

查看:337
本文介绍了如何保存和运行在腻子Java文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是个完整的新手在AWS(亚马逊网络服务),所以这可能是一个基本的问题。

我在AWS上创建了一个EC2实例。我有一个Windows机器,所以我用腻子与Linux实例连接。

I created an EC2 instance on AWS. I have a windows machine so I'm using PUTTY to connect with the Linux instance.

我的EC2实例建立连接后,我用下面的命令来编写Java code,

After getting connected with my EC2 instance, I used the below command to write the Java code,

vi java First.java

写上面的code后,我得到了下面的屏幕,我写了Java code一个简单的Hello World,

After writing the above code, I got the below screen and I wrote the Java code for a simple "Hello World",

输入图像的描述在这里

现在的问题是,我坚持在这里,我应该怎么做才能挽救我上面写的?它将被保存在我的笔记本电脑或在EC2?有没有通过它我可以简单地上传文件,然后只是从终端运行的方式?

The problem is now I'm stuck here, what should I do to save what I have written? Where it will be stored, in my laptop or on the EC2? Is there a way through which I can simply upload the file and then just run it from the terminal?

在此先感谢。

推荐答案

我使用的腻子,因为近2年。

I am using putty since almost 2 years..

ü应该使用打开vi编辑器六filename.java

U should open the vi editor using "vi filename.java"

键入程序,然后说Esc键:WQ忽视了空间。而Esc键是键盘上的ESC键..

Type the program and then say "Esc : wq" ignore the spaces.. And Esc is the Esc button on keyboard..

然后使用javac的filename.java

Then compile your program using "javac filename.java"

N键则运行使用Java filename.java

N then run using java filename.java

这篇关于如何保存和运行在腻子Java文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆