1024programmer Java Configure gedit as the most powerful compilation tool (C, C++, Java)

Configure gedit as the most powerful compilation tool (C, C++, Java)

Enter root mode

1 sudo -i

Open gedit

1 gedit

Configure gedit as the strongest compilation tool (C, C++, Java) - article picture

&# 160;

In the preferences, you can choose the color theme, line number, etc. of the text editor

Please complete this operation before proceeding to the next step

 

dconf-editor

Configure gedit as the most powerful compilation tool (C, C++, Java) - article picture

Enter the last item of the terminal in plugins, cancel use-them-colors, if gedit is not installed -plugins

Execute

sudo apt-get install gedit-plugins

 

Then we proceed to the next step, Write Sell to compile and run the code in gedit

 

Configure gedit as the strongest compilation tool (C, C++, Java) - article picture

Click on the external management tool

 

Configure gedit as the strongest compilation tool (C, C++, Java) -  Article picture

Only this content, let’s click the plus sign in the lower left corner

Create the first tool: Compile #The name can be arbitrary

 

Configure gedit as the strongest compilation tool (  C, C++, Java) - Article picture

Configure gedit to be the strongest  Compilation tools (C, C++, Java) - Article picturesConfigure gedit for the strongest compilation  Sharp tools (C, C++, Java) - Article pictures

#!/bin/sh
fullname=$GEDIT_CURRENT_DOCUMENT_NAME
name=`echo $fullname | cut -d. -f1`
suffix=`echo $fullname | cut -d. -f2`
if [ $suffix = “c” ]; then
gcc $fullname -o $name -O2 -Wall -std=gnu99 -static -lm
elif [ $suffix = “cpp” ] || [ $suffix = “c++” ] || [ $suffix = “cc” ] || [ $suffix = “cxx” ] || [ $suffix = “C ” ]; then
g++ $fullname -o $name -O2 -Wall -std=gnu++0x -static -lm
elif [ $suffix = “java” ]; then
javac $fullname – encoding UTF-8 -sourcepath . -d .
fi

View Code

 

Copy these shell commands into it and set the shortcut key to Ctrl+ F5 #Of course you can also set it yourself, but be careful not to conflict with hotkeys

Now we set up the shell script to run

Configure gedit as the strongest compilation tool (C, C++, Java) - article picture

Configure gedit as the strongest compilation tool (C, C++, Java) - article pictureConfigure gedit as the strongest compilation tool (C, C++, Java) - article picture

#!/bin/sh
fullname =$GEDIT_CURRENT_DOCUMENT_NAME
name=`echo $fullname | cut -d. -f1`
suffix=`echo $fullname | cut -d. -f2`
dir=$GEDIT_CURRENT_DOCUMENT_DIR
if [ $ suffix = “c” ]; then
gnome-terminal –hide-menubar –working-directory=$dir -t “Terminal-$name” -x bash -c “$dir/$name; echo;echo 'press ENTER to continue';read”
elif [ $suffix = “cpp” ] || [ $suffix = “c++” ] || [ $suffix = “cc” ] || [ $ suffix = “cxx” ] || [ $suffix = “C” ]; then
gnome-terminal –hide-menubar –working-directory=$dir -t “Terminal-$name” -x bash -c “$dir/$name; echo;echo 'press ENTER to continue';read”
elif [ $suffix = “java” ]; then
gnome-terminal –hide-menubar – -working-directory=$dir -t “Terminal-$name” -x bash -c “java $name echo;echo 'press ENTER to continue';read”
fi

View Code

Copy this Shell and set the shortcut key to F5. #Customizable, be careful not to conflict with hotkeys

 

Okay

 

Now let’s try the effect

Write a basic java statement:

Configure gedit as the strongest compilation tool (C, C++, Java) - article picture

 

Press Ctrl+F5

 

Configure gedit as the strongest compilation tool (C, C++, Java) - article picture

As you can see, the following tool output shows that it has The newly created compilation tool was called and completed

We continue to press F5 to start running

 

Configure gedit as the strongest compilation tool (C, C++, Java) - article picture

Program Works perfectly!

The steps are relatively simple, I hope this can help everyone

I hope everyone has a smooth journey on the road to Linux!

Reference article: https://blog.csdn.net/u012965890/article/details/38472149

 

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/configure-gedit-as-the-most-powerful-compilation-tool-c-c-java-3/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: 34331943@QQ.com

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索