Keyul
Keyul

Reputation: 759

javac: file not found in Ubuntu Java

Getting errors in Ubuntu while running command ./run1.sh

javac: file not found: edge.java
Usage: javac <options> <source files>
use -help for a list of possible options
Error: Could not find or load main class median_degree

In run1.sh file

javac -cp .:libs/java-json.jar:./src edge.java ./src median_degree.java
java -cp .:libs/java-json.jar:./src median_degree

File Structure

for java class

enter image description here

Can anyone help on how to write script file for this? I have tried lots options but none of them is working. Thank you

Upvotes: 0

Views: 1089

Answers (1)

Maarten Bodewes
Maarten Bodewes

Reputation: 94058

Try this:

javac -cp .:libs/java-json.jar ./src/edge.java ./src/median_degree.java

as the source files are not part of the class path and needs to be supplied as source files using the full path.

Upvotes: 1

Related Questions