How to run source code downloaded from github
Solution 1
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
Solution 2
You have to import the Project!
From the main menu bar, select command link File > Import.... The Import wizard opens.
Select General > Existing Project into Workspace and click Next.
Choose either Select root directory or Select archive file and click the associated Browse to locate the directory or file containing the projects.
Under Projects select the project or projects which you would like to import.
Click Finish to start the import.
Shady Programmer
Updated on February 01, 2020Comments
-
Shady Programmer over 4 years
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:
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.
-
Shady Programmer over 8 yearsThat's exactly what I've done and No projects show up under "project select"
-
FlowX over 8 yearsMaybe this hepls;) Why “no projects found to import”?
-
Shady Programmer over 8 yearsOkay, I've succesfully installed maven and ant. I've opened cmd window in the folder and ran the command ant build. A lot happened with few warning but the overall consensus was "Build successful" but I don't see anything changed or created in the folder, what's going on and how do I actually run something ?
-
Julien Revault d'A... over 8 yearsOnce the build is successful, you'll find the built binary inside the lib folder : lib/jgraphx.jar
-
Julien Revault d'A... over 8 yearsjust in case : jgraphx is a library, it's not a software you can launch to create diagrams. You use is by adding the built jar inside your java project andthen you use the API to create your diagrams (or diagram creator), you can see examples here github.com/jgraph/jgraphx/tree/master/examples/com/mxgraph/…
-
Shady Programmer over 8 yearsEven though ant said that build was successful there was nothing created so I've built it with Maven which created "target" folder and actually built the files. I know that jgraphx is a library and I'm trying to run exactly the HelloWorld example that is in your link. So should I go to project properties > Java Build path add my jar and then open the HelloWorld.java example file in my project, will that be enough or do I need add any other files as well as HelloWorld.java ?
-
Shady Programmer over 8 yearsJust tested it. IT WORKS! IT'S ALIVE! I'M SO HAPPY! THANK YOU!