My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

How can I solve the problem of “org.springframework.context.” in Java at Visual Studio Code on a Mac?

Gustavo Benedito Costa's photo
Gustavo Benedito Costa
·Mar 3, 2018

I know you suggest me to use the IDEs instead, as Eclipse, IntelliJ and NetBeans, but I would like to stick with Visual Studio Code. These IDEs do not have an attractive interface I want, to improve my vision. It is my particular taste.

I am an user of macOS and I am developing a Java web app with Spring framework, because my professor demanded us to do a webservers homework for the next week. I am facing the problems of Java in Visual Studio Code.

I followed the half tutorial of Build Java Web Apps with VS Code and in the middle, it failed to compile because it didn't find org.springframework.context.* dependency or library. I have already added a dependency or library classpath to the build.gradle , but it still didn't find it.

The error:

Error: Unable to initialize main class hello.Application
Caused by: java.lang.NoClassDefFoundError: ApplicationContext

Please, check my GistGithub with four files (Application.java , build.gradle , launch.json and pom.xml :

gist.github.com/gusbemacbe/7d4423bb27d05201..