Search code examples
javagithubintellij-ideaclone

Github Clone in Intellij Idea


I want to create a sparse matrix using Efficient Java Matrix Library (EJML).This is the link (http://ejml.org/wiki/index.php?title=Main_Page). I am using intellj I Idea for Java coding. In EJML website it is suggested that

The command to clone it is: git clone https://github.com/lessthanoptimal/ejml.git

I click on check out from version control. Then select Github from that and get a Error message. Cannot run program "git.exe": CreateProcess error=2, The system cannot find the file specifiedI solve this problem after installing Git. A new project folder created. But don't find where to write down my Java code.In normal Intellij Idea project a src folder created. Then I right click on it and create a class file. Here there is no option to create class file. I add a picture of my current state.

This is the homepage of Intellj Idea enter image description here

enter image description here

After Complete of Cloning

Thank You In advance


Solution

  • Do you want to use EJML, or do you want to work on EJML? It's unlikely you want to clone it.

    Instead, create a project and add EJML as a dependency. Using Maven, add this to your pom.xml:

    <dependency>
      <groupId>org.ejml</groupId>
      <artifactId>ejml-all</artifactId>
      <version>0.33</version>
    </dependency>
    

    Using Ivy, add this to ivy.xml:

    <dependency org="org.ejml" name="core" rev="0.33"/>
    

    Using Gradle, add this to build.gradle:

    compile group: 'org.ejml', name: 'core', version: '0.33'
    

    Update: I tried adding it to a project of mine, and while the EJML web site mentions version 0.34, Maven Central only seems to have 0.33 currently.

    To create a project in IntelliJ IDEA from scratch:

    • Click "Create New Project"
    • Make it a "Java Project" (default), and click Next
    • Click Next to bypass creating from a template
    • Give the project a thoughtful name, like "Sparse", and click Finish
    • Right-click on the project at the upper left and click "Add Framework Support..."
    • Check "Maven" and click "OK"
    • In the pom.xml, add these lines after the :

      org.ejml ejml-all 0.33

    • IntelliJ IDEA will prompt that the Maven project needs to be imported. Allow it.

    On the left side under the project you can open src/main/java in the tree and right-click on java and choose New > Java Class and you should be ready to go.