Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding .class files to an Eclipse project

This is a total newbie question, but I can't figure it out so I figured that I would ask it here and see what happened.

Here's the problem: For my java programming class, we are supposed to download a .class file created by our instructors containing a custom-made class with methods that we are supposed to use in an assignment. I already know all of the code to create the class within my actual program, but I can't figure out which directory to place the .class file in. I have tried the src and bin folders inside the project directory, and even placed it directly into the project directory, but nothing seems to work. My instructors say to just put it in the same directory as my java program, but they are using jGRASP. What am I doing wrong?

like image 329
James Avatar asked Dec 01 '10 20:12

James


2 Answers

You can place the class file anywhere, just be sure to add its directory to your project's build path. Right click on the project, then properties at the bottom then build path, til you find add class folder.

like image 189
Hovercraft Full Of Eels Avatar answered Oct 04 '22 15:10

Hovercraft Full Of Eels


You have to create a project, or open your project if you have it already, then, while you are in the Java view, select File > New > File. It will open a window, you can create your file there and choose in which project folder do you want to put it. If in that window you press the button "Advanced >>" it will give you the option to "Link to file in the system", check it, and then you can browse your folders to the downloaded file.

I don't know if this solves your problem, it's what I understood from your question.

like image 30
amypellegrini Avatar answered Oct 04 '22 17:10

amypellegrini