-1

A have folders test/labs/tryouts in E:....\exps and two .java files inside tryouts. The location is added into CLASSPATH: E:....\exps.

import test.labs.tryouts.*;

Doesn't work (it's hihlighted with red) and the use of described in .java files classes also fails:

Uncompilable source code - cannot find symbol
  symbol:   class Bullet
  location: class javaapplication1.Test1
at javaapplication1.Test1.main

What is wrong?

sisyphus
  • 6,174
  • 1
  • 25
  • 35
parsecer
  • 4,758
  • 13
  • 71
  • 140

1 Answers1

1

Quotes source: https://docs.oracle.com/javase/8/docs/technotes/tools/windows/classpath.html

Most IDEs are using -cp or -classpath option to set classpath for each project which is

preferred over setting the CLASSPATH environment variable because you can set it individually for each application without affecting other applications and without other applications modifying its value

Problem with it is that

-classpath replaces the path or paths specified by the CLASSPATH environment variable while the tool runs: java, jdb, javac, javah and jdeps.

So try to add that path to your project rather than CLASSPATH. More info: How to setup classpath in Netbeans?

Community
  • 1
  • 1
Pshemo
  • 122,468
  • 25
  • 185
  • 269