0

I have a project with four packages. One of them has the same name as the project (to lower case) and within a source code with the main method.

When i click build and clean I generate a ".jar" which starts the main method with this source code. I have another source code in another package of the project, i can click on it and run but i don't know how to build and clean from this source.

Do you know how to do this?

Rashwan L
  • 38,237
  • 7
  • 103
  • 107
Nico
  • 374
  • 2
  • 4
  • 17

2 Answers2

0

The code from all the packages are included in that jar which is build from the project. But of course by default it can only run one of the main methods.

If you want to start another one call

java -jar JAR-name your.onotherpackage.with.Main
Rashwan L
  • 38,237
  • 7
  • 103
  • 107
Zielu
  • 8,312
  • 4
  • 28
  • 41
0

Go to Project properties > Run > Main Class:

When I clicked on build and clean I got a .jar with the main method i wanted.

Rashwan L
  • 38,237
  • 7
  • 103
  • 107
Nico
  • 374
  • 2
  • 4
  • 17