Question

I got a code base from a source and trying to build using intellij Idea 13.1. I am a .net guy and trying to set this up. Could you please help on how to resolve this error. I tried to setup the maven but no luck.

Information:Using javac 1.7.0_55 to compile java sources
Information:java: Errors occurred while compiling module 'main'
Information:Compilation completed with 100 errors and 0 warnings in 3 sec
Information:100 errors
Information:0 warnings
C:\Java\src\main\java\com\bc\testmod\models\MEntity.java
Error:(3, 1) java: package javax.persistence does not exist
Error:(12, 2) java: cannot find symbol
  symbol: class Entity
Error:(13, 2) java: cannot find symbol
  symbol: class Table
Was it helpful?

Solution

Assuming your codebase is maven-based I recommend you to do the following:

  1. Set up maven (this includes setting environment variable M2_HOME for Maven 2 and JAVA_HOME)
  2. Get a clean codebase (from VCS for example);
  3. Do File -> Open in IntelliJ Idea and open root pom.xml;
  4. Let maven do its job - creating modules, downloading dependencies, etc. This may take a while.
  5. Now you need to build your project. Most likely you'll do that just as you doing it now.

OTHER TIPS

Make sure that you have a JDK defined under:

File -> Project Structure -> SDKs

And that you project is associated with the SDK/JDK here:

File -> Project Structure -> Project -> "Project SDK"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top