Skip to content

Latest commit

 

History

History

README.md

Overview

Compiling and Running Java Code

Manual

dir setup:

├──com
│  ├──company
│     ├──Main.java
│
├──test
│  ├──A.java

Main.java

package com.company;
import test.A;
public class Main {
    public static void main(String[] args) {
 // write your code here
        A a =new A();
        a.run();
    }
}

A.java

package test;
public class A {
    public void  run(){
        System.out.println("Hello World");
    }
}

compile:

javac -d . .\com\company\Main.java

run:

java .\com\company\Main.java

Vs Code's Project Manager for Java (microsoft)

Vs code

Vs code pro name

generated files:

vs code java pro

But not compatible with IntelliJ IDEA!!

intellij problem

Making this setup compatible with IntelliJ IDEA by making a sub dir/package

intellij solve

IntelliJ IDEA

Basic dir setup with template checked:

init:

temp checked

intellij init

Run Configuration:

run config

Basic dir setup with template un-checked:

init:

temp un-checked

intellij init un

Run Configuration:

run config-2