Error: Could not find or load main class in module Pdvapplication

Asked

Viewed 77 times

0

I can’t run the PDV application to test. I cloned the project from github to my folder and ran it using Maven in the Intellij IDE. Inside the Intellij the main is this below. It runs error-free on Intellij, but when running on Powershell gives this error = Error: Could not find or load main class net.originmobi.pdv.Pdvapplication Caused by: java.lang.Classnotfoundexception: net.originmobi.pdv.Pdvapplication

Edit¹: in the manifest file it looks like this: Manifest-Version: 1.0 Main-Class: net.originmobi.pdv.Pdvapplication

Can anyone help ?

package net.originmobi.pdv;

import java.util.Locale;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.i18n.FixedLocaleResolver;

@SpringBootApplication
public class PdvApplication extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        setRegisterErrorPageFilter(true);
        return application.sources(PdvApplication.class);
    }

    public static void main(String[] args) {
        SpringApplication.run(PdvApplication.class, args);
    }

    @Bean
    public LocaleResolver localeResolver() {
        return new FixedLocaleResolver(new Locale("pt", "BR"));
    }

}

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.