2

So I've set up my IntelliJ 14 with .jar files I want to use in the following screenshot: enter image description here

You can see that I can import code from the mnist-tools.jar file but when I try to import the HeapTracker file in heapTracker.jar IntelliJ isn't recognizing it. How can I fix this?

letter Q
  • 14,735
  • 33
  • 79
  • 118
  • [Is the use of Java's default package a bad practice?](http://stackoverflow.com/questions/7849421/is-the-use-of-javas-default-package-a-bad-practice) and [How to import a class from default package](http://stackoverflow.com/questions/2193226/how-to-import-a-class-from-default-package). Short answer, it's not possible; Long answer is it's messy and should just be avoided – MadProgrammer Apr 17 '15 at 00:06

1 Answers1

2

You can't import classes from the default package. You want the file in the jar to be in a specific package.

From the JLS 7.5.1. Single-Type-Import Declarations:

The name must be qualified (§6.5.5.2), or a compile-time error occurs.

Anubian Noob
  • 13,426
  • 6
  • 53
  • 75