• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Gah! I've forgotten my basics...

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

Can someone please refresh my memory?

Cheers.
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 1843
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is an IDE question, so I'm moving it to our IDE forum...
 
John Brookes
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can't decompile them because I'm supposed to be using them as-is (so no .java files). I'll see if I can mess with the classpath.

And yeah I'd normally use BlueJ but it's messing around - like I said, not done any coding for a while.

Thanks for the help guys.
 
John Brookes
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Fantastic...



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
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic