-5

This question is an exact duplicate of:
Running Java Program from Command Line Linux

I know how to run a single java class but I have a special directories architecture on Eclipse:

+- root
   |
   +- folder-1
   |   |
   |   +- src
   |   |
   |   +- bin
   |
   +- folder-2
   |
   +- folder-3
   |   |
   |   +- src
   |       |
   |       +- package1
   |       |   |
   |       |   +- subpackage
   |       |       |
   |       |       |- Main.java
   |       |
   |       +- package2
   |       |
   |       +- package3
   |       |
   |       +- package4
   |
   +- folder-4

I have managed to compile each folder's "src" folder inside its "bin" folder. The main "src" (outside specific folders) is equally compiled to the main "bin" folder.

My question is how to run from the Linux command line Main.java which uses some classes located in the subpackage and also uses an auxiliary class in the main "src" folder.

0

1 Answer 1

0

go to bin folder and use

java <this.is.your.main.class.package>.<ThisIsYourMainClass>

but your bin folder must be on the same level as your src folder and has the same directory structrue.

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

5 Comments

Also a quick google revealed this post from SO: stackoverflow.com/questions/3692229/…
Regarding to bin folders, the structure would be the following: * bin (for auxiliary classes) * folder3 ** bin *** package1 (the Main I want to run) **** subpackage1 (contains other classes also used by the Main) So where must I go?
you din have the bin directory in folder3? Where are your classes stored?
Of course, folder3 has a bin directory.
so go there and try to do the following: java package1.subpackage.Main

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.