hey everybody
im new to java
i have a book and im learning the language from it
but i want to know a compiler where i can run the programs
i have "IDEA" but it is really confusing
can anybidy help me please???

Dani AI

Generated

A short, practical primer that builds on the thread (thanks to , and ) and gets a beginner from source file to running program without an IDE.

A minimal, reliable workflow:

  • Create a file named Hello.java containing:
public class Hello {
    public static void main(String[] args) {
        System.out.println("Hello, world");
    }
}
  • From a shell/command prompt, compile with:
    javac Hello.java
  • Run the compiled class with:
    java Hello

Key rules and common troubleshooting:

  • The filename must match a public class name (here Hello). If they differ, the compiler will fail.
  • If javac is not recognised, the JDK's bin directory is not on the system PATH. On Windows that is an Environment Variable; on macOS/Linux it is typically edited in the shell profile.
  • If java Hello reports "Could not find or load main class" check that the current directory is the one containing Hello.class and that any package statement is reflected as a matching folder structure.
  • Beware of hidden file extensions on Windows so files are not Hello.java.txt. Also check file encoding if source contains non-ASCII text.

Notes on editors and IDEs:

  • A plain text editor (Notepad++, VS Code, Sublime, etc.) and the command-line workflow teach what happens under the hood. Educational IDEs (BlueJ, DrJava) are simpler for first programs. Full IDEs such as IntelliJ IDEA provide big productivity gains later but have a learning curve — as suggested, learning the tools pays off once the fundamentals are understood.

These steps remove uncertainty and make it easy to confirm the environment is working before moving back into an IDE.

Recommended Answers

All 6 Replies

download the JDK from the Oracle website, don't bother yet with an IDE.

OK, since you don't mention what operating system you are running under, I will have to assume you are using Windows, though the answer for Linux and MacOS are more or less the same anyway. With Windows, the only Java compiler of importance is the one from Oracle themselves; under Linux there are a few other options, but generally speaking you want the Oracle release as well.

What you want to do is install the Java Development Kit, Standard Edition for your system.

IDEA (IntelliJ) is an IDE, not a compiler. You need to install that separate.
Of course you don't need a compiler to run Java programs, you need a Java runtime (which comes with the compiler).
You need a compiler only to compile the source code of whatever you end up writing.

thank you guys for the links

i downloaded them but i dont have any application where i could write
do i have to write the codes in notepad and then compile it in binary format or is there any application like we have in turbo c++??

you said you have IDEA... Do learn your tools.

you can write them in notepad, save them as .java files, compile and run them.
there are tons of IDE's out there (IDEA included) but if you don't know how to use them, they won't really help you out, I'm afraid.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.