Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run source code downloaded from github

This is getting quite frustrating lately as I've downloaded various source codes for various programs from github and I don't know how to build them or run them. Now mind you, I'm not new to programming but this particular area of not knowing how to get things started when I get someones project files is absolutely killing me. What I have is this:

Source files

What am I supposed to do now to build and run one of their examples ?

Before anyone starts hatin' on me for that question:

I've read the manual that was attached with these files and it gives general overview of what can be found in the folders and so on but they don't specify how to build it. Also I have eclipse for Java set up and tried to import these files as a project but eclipse rejected and said that no project can be found. I tried running individual java files but couldn't get them to compile because there was no "ant file" ( what is going on ? ) Later on I found something which I think was that ant file and opened it in conjunction with the file I wanted to run but no success.

like image 772
Shady Programmer Avatar asked Jan 31 '16 20:01

Shady Programmer


People also ask

How do I run a script from GitHub?

To run a python file type “python filename.py” into the command line then hit enter. The README for our code says that “main.py” should be run, so the command is “python main.py”. The script will now run.


2 Answers

This is a maven and ant project, you need to download and install maven : https://maven.apache.org/

And download and install ant: http://ant.apache.org/

The build.xml file is the configuration for ant The pom.xml is the configuration for maven

Look inside the ant.xml, you will find "<target ..." elements. For example one target is build, to run it just opent a commande line and :

ant build
like image 172
Julien Revault d'A... Avatar answered Oct 05 '22 05:10

Julien Revault d'A...


You have to import the Project!

  1. From the main menu bar, select command link File > Import.... The Import wizard opens.

  2. Select General > Existing Project into Workspace and click Next.

  3. Choose either Select root directory or Select archive file and click the associated Browse to locate the directory or file containing the projects.

  4. Under Projects select the project or projects which you would like to import.

  5. Click Finish to start the import.

help.eclipse

like image 34
FlowX Avatar answered Oct 05 '22 07:10

FlowX