So I do no coding for six months and suddenly I can't remember anything!
I'm doing a data structures assignment which requires me making up a couple of my own data structures and other classes and interfacing them with four class files that have been provided as either objects for me to use or driver files for the UI.
Thing is, I haven't got a clue how to use them in my own project - I go to "Add to project..." (using JBuilder 3 or BlueJ) and it won't recognise .class files - it wants .java ... and now it's completely stumped me.
Not the best start to what I'd orignally figured would be my easiest assignment of the semester
Do you have the .java files? If so, it's probably best to delete to .class files. JBuilder (and other IDEs) will typically show you your java files, and will compile them, and organise the .class files for you, in a seperate hidden location. Just place your .java files all together in your project, and you should be able to get it to compile.
If you don't have the original java files you could just tell JBuilder that these class files are an 'external library' which is needed to compile your project. I think it's in 'project properties' -> 'paths' -> 'Required Libraries'
Alternatively you might like to try decompiling the class files. After all you want to get back your original source code right? This sounds complicated, but actually its a very easy thing to do. Just download DJ decompiler, and open your class files into it, to retreive the original java.
JBuilder 3! Thats a little out of date these days isn't it?
Well this is really an IDE question, but if you have compiled class files you need to add to your classpath. So, file out where you add resources such as jar files etc. to your project and add them that way.
Well that's sorted - even figured it out in BlueJ so I think it's about time I uninstalled JBuilder
Only problem I've got now is that the examiner hasn't left any documentation for one of the pre-made classes he's given to us. I've got an interface file and documentation on that, but the interface doesn't include methods for making new instances.
Oh, and it turns out I hadn't forgotten my basics - all that path stuff was completely new to me. Confidence just shot straight back up again
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop