简体   繁体   English

在终端上使用gedit打开Java文件时出现问题

[英]Problems opening a java file using gedit on terminal

I'm using the terminal to test all my Java code. 我正在使用终端测试我的所有Java代码。 I have a Mac. 我有Mac。 When I compile for example: 例如,当我编译时:

->javac MyJava.java (it compiles perfectly) -> javac MyJava.java(完美编译)

->java MyJava (it works perfectly) -> java MyJava(完美运行)

But the problem is when I'm trying to edit that java file using gedit, like this: 但是问题是当我尝试使用gedit编辑该java文件时,如下所示:

->gedit *.java -> gedit * .java

it displays an error: 它显示一个错误:

->(gedit:12827): Gtk-WARNING **: cannot open display: ->(gedit:12827):Gtk警告**:无法打开显示:

What would be the cause? 是什么原因? Also I already have installed gedit on my Mac, but still it is giving the same problem. 另外,我已经在Mac上安装了gedit,但仍然出现相同的问题。

Regards! 问候!

You're trying to launch an editor (gedit) that requires Xwindows. 您正在尝试启动需要Xwindows的编辑器(gedit)。 Download and install a Xserver (like XQuartz ) or use a terminal based editor like vim, or use a native Mac editor. 下载并安装Xserver(如XQuartz )或使用基于终端的编辑器(如vim)或使用本机Mac编辑器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM