Creating WAR using Netbeans

14,420

If your app is web project, Just say clean & build from Netbeans it will create a war file in your project/target directory

Share:
14,420
user10101
Author by

user10101

Updated on June 04, 2022

Comments

  • user10101
    user10101 almost 2 years

    I am creating war file from Netbeans. Previously I created jar file using Netbeans, it worked fine (in command prompt). But when I am running war file from command prompt, I am getting this error:

    Failed to load Main-Class manifest attribute from WebApplication2.war.
    

    I have set main class from Netbeans during creation of jar

    Project->properties->Run->Choosed main class)..
    

    Do I have to set any mainclass during war creation (as web application does not have any main class, it just has JWS and servlets, how can we set main class)?

  • jmj
    jmj about 12 years
    by doing this you should have .war file created
  • Igor
    Igor almost 11 years
    @JigarJoshi what if it's not a web project?
  • jmj
    jmj almost 11 years
    @Igor why do you want to create war for non web project ?
  • Igor
    Igor almost 11 years
    @JigarJoshi I want to migrate the project from NetBeans to Eclipse