user4612022
user4612022

Reputation:

Java Compile and Run Multiple Classes on Linux

I have two class file in same folder, both in same package (package hw9;). I can run them in netbeans but when I try to compile in src folder

[user@manjaro hw9]$ javac * 
[user@manjaro hw9]$ java Hw9
Error: Could not find or load main class Hw9

I take this error.

Upvotes: 0

Views: 279

Answers (1)

Reimeus
Reimeus

Reputation: 159754

Compile Hw9.java one directory up,

javac hw9/*.java

then run

java hw9.Hw9

Upvotes: 1

Related Questions