0

I know this has to be an easy fix, but for the life of me I can't find the answer. I'm working on Windows 10 -> Netbeans 8.2 and just trying to create a basic WebApplication1 project. But I always get...

package com.mysql does not exist

I created a database connection in Services and was able to access the database with the same (Connector/J driver).

Here's what I've tried with "WebApplication1" in projects:
* added [mysql-connector-java-5.1.46-bin.jar] to WEB-INF -> lib;
* tried [Tools][libraries][Add JAR/Folder]
* set CLASSPATH in System Variables (don't think I need this)
* cleared Netbeans cache

if I right click Libraries->Add JAR/Folder and select the jar file, I get the mysql drop down after typing com., but still "does not exist"; otherwise it just shows oracle and sun.

If I remove the "com.mysql" import, I can run the file. It's just a very, very simple print message routine; the code is anorexic.

I'm thinking I should just be able to add the jar file to WEB-INF/lib and everything should be fine.

Any clues...or is there more information I need to supply?

Last screen shot of environment: enter image description here

smbelow
  • 1
  • 4
  • What are you trying to import? Please show the code that triggers this error. Technically there is no package `com.mysql`, there is a package `com.mysql.jdbc`. – Mark Rotteveel Apr 02 '18 at 13:05

1 Answers1

0

have you tried to add the libraries relative to the project ?? -->check this netbeans : add library permanently

Jamal Alkelani
  • 606
  • 7
  • 19
  • I tried that, but no go. There isn't a problem with the connector being at: C:\mysql-connector-java-5.1.46\mysql-connecotor-java-5.1.46.jar is there? – smbelow Apr 01 '18 at 22:23