0

I have a file named "BibliotecaMusicalControle.java", that contains my main function, and when I try to compile it, I receive a message:

javac BibliotecaMusicalControle.java

Errors when trying to compile the code

I also have the folders "modelo" and "visao", which contains some files that I imported on the class I tried to compile

Folder modelo:

Folder modelo

Imports I made on BibliotecaMusical.java

So I wanted to know how I can compile the BibliotecaMusicalControle.java with the imports that I made.

1
  • I think you have to set the class path here. You need to compile from the "top" of your project directory, and specify a full path to the file you are compiling Commented Aug 15, 2021 at 17:59

1 Answer 1

1

If you have a directory structure like this:

mySrc
   controle
   modelo
   visao

You need to compile from the "top" of the directory structure, and you need to specify a full path to the file. You also need the files in modelo and visao compiled so the .class files are available.

myScr> javac controle\BibliotecaMusicalControle.java

\ is a file separator on Windows. On Mac and Unix it's /.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.