Skip to content

Instantly share code, notes, and snippets.

@gprasant
Created June 9, 2015 23:58
Show Gist options
  • Save gprasant/d3cac90b22923929119c to your computer and use it in GitHub Desktop.
Save gprasant/d3cac90b22923929119c to your computer and use it in GitHub Desktop.
Steps to create a Java project

Setting up a new java project

  1. Make a new directory for the project

  2. Add a pom.file with the contents (Update it to your project name and dependencies as required)

     <?xml version="1.0" encoding="UTF-8"?>
     <project xmlns="http://maven.apache.org/POM/4.0.0"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
         <modelVersion>4.0.0</modelVersion>
    
         <groupId>com.codesolid</groupId>
         <artifactId>HelloJUnit</artifactId>
         <version>1.0</version>
    
         <dependencies>
             <dependency>
                 <groupId>junit</groupId>
                 <artifactId>junit</artifactId>
                 <version>4.11</version>
                 <scope>test</scope>
             </dependency>
         </dependencies>
    
     </project>
    
  3. Start IntelliJ. Import Project and select the pom.xml file from above. Check "Import Maven projects automatically" from the next dialog window. Click next on the subsequent dialogs to complete the installation.

  4. Run Build -> Make Project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment