Java compile error in Intellij IDEA 13.1

10,274

Solution 1

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.

Solution 2

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"

Share:
10,274
pili
Author by

pili

Updated on June 04, 2022

Comments

  • pili
    pili almost 2 years

    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
    
  • Kaveh Ghahremani
    Kaveh Ghahremani almost 10 years
    I would check on maven after you've configured that your JDK/SDK set up is correct
  • pili
    pili almost 10 years
    Thanks Alexey, This worked great! Now I am getting another error which could be related to something else, "Unable to load class [com.microsoft.sqlserver.jdbc.SQLServerDriver]".