1

I am very new to java

I downloaded an open source java project

which has this line of code

import sun.swing.SwingUtilities2;

I am getting this error

Error:(94, 38) java: cannot find symbol
  symbol:   variable SwingUtilities2
  location: class org.apache.ctakes.gui.component.SmoothToolTip.SmoothToolTipUI

I have downloaded this jar file from here

http://www.java2s.com/Code/Jar/j/Downloadjsdgstubsjre15jar.htm

I am trying to add it to my project

through going to project structure in IntelliJ and then add library

but I get another error when i click the ok button

enter image description here

how to import this library in my project ?

asmgx
  • 7,328
  • 15
  • 82
  • 143

1 Answers1

1

It's like to be a maven project. if so, why not trying to add the dependency instead of downloading the jar file manually?

try to add:

<!-- https://mvnrepository.com/artifact/com.sun/tools -->
<dependency>
    <groupId>com.sun</groupId>
    <artifactId>tools</artifactId>
    <version>1.5.0</version>
    <scope>system</scope>
</dependency>

to your pom file and then build the project again. this way maven download it for you automatically.

Majid Roustaei
  • 1,556
  • 1
  • 20
  • 39
  • how to import these libraries too org.hibernate.SessionFactory / org.springframework.jdbc.core.RowMapper / org.springframework.jdbc.core.simple.SimpleJdbcTemplate – asmgx Dec 02 '19 at 06:21
  • just find them in maven repository sites like: [link](https://mvnrepository.com/), or you can use google to to that. after finding them add them to your pom.xml file in the project in tag – Majid Roustaei Dec 02 '19 at 06:26