Danny Bentley
Danny Bentley

Reputation: 53

Add a class in Netbeans.

I have a homework assignment and the instructor has emailed me a .class file.

I have unsuccessfully attempted:

  1. To add it to my folder where my .java files are.
  2. I have tried to add it to my /build folder.
  3. I have also tried to import it through my Libraries as and add folder.

I have spent a good part of my day without any luck. I know it is something super simple I have overlooked.

I have added a screen shot of my computer to show you what I have tried.

Thank you for your help.

Netbeans project, attempt to use existing class

Upvotes: 1

Views: 343

Answers (1)

jorgesumle
jorgesumle

Reputation: 21

A class is not a code file, it's a compiled file (it uses Java bytecode), so there is no point in doing that. NetBeans creates .class files automatically when it executes a project. Tell the instructor to email you the code file. Never try to execute something you don't know what it is.

Upvotes: 1

Related Questions