Reputation: 3168
Is it possible to use a class from a .class
file in IDEA? For example, if I have a directory with two files Ball.java
and DemoBall.class
, how would I use DemoBall
in Ball
? It says it cannot find symbol
when compiling. I just want to tell IDEA that there is a compiled Java class in the directory and to recognize that, I don't want to decompile it.
Upvotes: 1
Views: 133
Reputation: 24616
EDIT:
DemoBall.class
is located. Click OK.Original(This one it seems is not the right way):
Project
, with simple Java Class
named Ball.java
inside it, having one main
method(empty body).out
folder.DemoBall.class
. Now through Windows Explorer/File System
, go to out
folder and paste DemoBall.class
inside out\production\ProjectName
folder.DemoBall
class, inside the main
method of Ball.java
class.Previously, I was wondering, as to why the red lines are coming still, even though, the program is running fine. But once, I restart, IntelliJIDEA, everythingy works fine, without showing any errors.
Upvotes: 1