Please click here if you are not redirected within a few seconds.
Java Development on Ubuntu › shanebow.com
Java Development on Ubuntu

Java Development

Install JDK

Multiple Versions

Install Maven

export JAVA_HOME=/usr/lib/jvm/default-java
export M3_HOME=/opt/maven
export MAVEN_HOME=/opt/maven
export PATH=${M3_HOME}/bin:${PATH}

IntelliJ IDEA

Project Organization

There isn't a strict convention for the root folder where IntelliJ IDEA Java projects should be created on Ubuntu or any other operating system. However, there are common practices that many developers follow for organizing their projects. Here are a few of the most typical root folder locations:

1. Home Directory (User Directory)

A common location for storing all personal development projects is directly in your home directory (~/), often under a subfolder like ~/projects or ~/dev.

~/projects/my-java-project

This keeps all your development work organized under a single folder within your home directory.

Source Control

To create a repository for a specific GitHub organization from IntelliJ IDEA, you need to follow a few steps. Here's how you can tell IntelliJ IDEA to create a repository in a specific GitHub organization:

Steps to Create a Repository in a Specific GitHub Organization:

  1. Connect GitHub to IntelliJ IDEA: First, make sure that your GitHub account is properly connected to IntelliJ IDEA:

    • Go to File > Settings > Version Control > GitHub.
    • Log in to your GitHub account by clicking Add Account and following the authentication process (via OAuth or token).
  2. Check GitHub Organizations: Once you’ve connected IntelliJ IDEA to GitHub, you need to ensure that your GitHub account can access your organizations.

    • If you’re part of multiple organizations, IntelliJ IDEA should show a list of all repositories associated with your GitHub account, including the ones belonging to organizations you are a member of.
  3. Create a New Git Repository in IntelliJ IDEA:

    • Open the project you want to push to GitHub in IntelliJ IDEA.
    • If your project is not yet initialized with Git, go to VCS > Enable Version Control Integration, and choose Git.
  4. Push to GitHub:

    • After enabling Git, you can push your project to GitHub.
    • Go to VCS > Git > Push (or Git > Commit and Push).
  5. Select the GitHub Organization:

    • In the dialog that opens, IntelliJ IDEA will ask where you want to push the repository. Click on the GitHub button, and if you’re not already logged in, it will prompt you to authenticate.
    • After authentication, IntelliJ IDEA will show you a list of all your available repositories and organizations. From here, you can choose Create a new repository.
  6. Choose the Organization:

    • When you choose to create a new repository, IntelliJ will ask you to enter the repository name and select the owner (which can be your personal account or any of the organizations you’re a member of).
    • From the Owner dropdown, select the GitHub organization where you want to create the repository. If you're part of multiple organizations, they will be listed here.
    • If you're not seeing your organization in the list, make sure your GitHub token or OAuth scope grants you access to repositories in that organization.
  7. Set Repository Visibility:

    • Choose whether the repository will be Public or Private.
  8. Push the Code:

    • Once you have selected the organization, set the repository visibility, and named the repository, click Create and then Push. IntelliJ IDEA will create the repository in the selected organization and push your local project to GitHub.

Summary of Key Steps:

By following these steps, you can easily create and push a new repository for your IntelliJ IDEA project into a specific GitHub organization.