Hello!

I have the following problem: when compiling a program in Eclipse, everything goes well and starts. And if you compile from the command line, then the launch does not reach because of a bunch of similar errors:

alt text

What needs to be corrected to compile successfully?

  • and the compilation line where? - rasmisha
  • javac MainWindow.java - wwvv
  • add the classpath where the classes are SettingsWindows, FieldPanel, FieldCalculator - Anton Feoktistov
  • as always in such cases I send to Skipy - Nofate


1 answer 1

Write the correct classpath . The compiler does not see the libraries in which you have these classes. This can be done using the cp compiler option and specifying *jar files or directories. Example:

 javac -cp lib1.jar:lib2.jar:lib3.jar:/lib/dir/:../:. MainWindow.java 

Used libraries can be viewed in the Eclipse project.

This should be done, even if you use samopisnye classes, in this case you need to specify all the directories (or packed .jar files) in which you have compiled .class files.

  • Wow, did not know about the colon, always; separated libraries, thanks - Anton Feoktistov