File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Where do I put these class (.class class, not class class) files?

 
Noah Sager
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm about to start my Java class in a week or so and the book we are using is making us use these premade "AVI" class files that as far as I know, act as an easy way to use AWT. Anyways, they include instructions on where to put them on a PC (in the root directory and then modify autoexec.bat) but I have absolutly no idea where to put them on my Mac running 10.2.6.
Any ideas?
Thanks,
Noah
 
Rob Ross
Bartender
Posts: 2205
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well what exactly are the PC instructions?
 
Noah Sager
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The audio-visual interface [avi] Package
You are advised to store the avi package on your C drive (or equivalent), in the folder avi.
Set the class path of the autoexec file in a Microsoft Windows-based system to set CLASSPATH=.;c:\
The avi directory contains the following nine files that each represent a class.

It then goes on to give docs about these nine class files:
Audio.class
Window.class
Memo.class
RadioButtons.class
Timer.class
Slider.class
CheckBoxes.class
FilmStrip.class
DialogBox.class

Noah
 
Jonathan Hendry
Ranch Hand
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can put the .class files in ~/Library/Java/Extensions
I believe java on OS X automatically looks in there, so you may not need to explicitly add it to a classpath.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64190
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are going to manually add them to the classpath, then you can put them just about anywhere.
If adding to ~/Library/Java/Extensions as Jonathon suggested (for per-user), or /Library/Java/Extensions (for system-wide), I'd jar up the classes into a single file just to keep things tidy.
I'd also keep an archive copy handy since reinstalling the OS* may not preserve such files.
hth,
bear

* Never had to do this on a Mac, but I like to be prepared just in case.
[ August 28, 2003: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64190
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Btw, are the class files not in any package hierarchy?
bear
 
Noah Sager
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I appologize that I am utterly new at this. They come in an "AVI" folder and code that uses them has an import statement that says "import avi.*"
I assume that's what you're speaking of.
I'll try putting them in ~/Library/Java/Extensions/ and see what happens.
Update:
Still no go. javac doesn't seem to see those files, based on the error code:

[ August 28, 2003: Message edited by: Noah Sager ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64190
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you include the avi folder?
bear
 
Noah Sager
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah. The classes are in /Library/Java/Extensions/avi/
Noah
 
Rob Ross
Bartender
Posts: 2205
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is the source code for those class files? Are you certain they are members of the avi package? This means they must all start with a statement that says:
package avi;
If they do not, they are not in the avi package; sticking them in a folder that is labled "avi" won't make them a member of that package. (It's necessary, but not sufficient)
 
Noah Sager
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah. They all start with that. Take Audio.class as an example:

If I have them in the right place, and it starts with "package avi", then why isn't it working? The example I'm trying to compile and run is directly off the included CD. As are those class files.
 
Rob Ross
Bartender
Posts: 2205
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try moving the whole avi folder into the top-level Library/Java/Extensions, instead of the one in your home directory.
Then try to create a simple no-action app that just imports one of those classes.
ie,
//foo.java
import avi.*;
public class foo{ } //that's all she wrote folks
//end foo.java
and compile that with
javac foo.java
and copy your compiler errors here.
We'll figure this out by cracky!
 
Noah Sager
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did all you said, and the same thing happens:

Oh, and just to verify I have the files in the right place, here's an ls:

That's just truncated "/Library/Java/Extensions/avi"
[ August 28, 2003: Message edited by: Noah Sager ]
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can't only JAR files be loaded into the Extensions directory? I would do the following to build JAR file containing those classes...
cd /Library/Java/Extensions/
jar cvf avi.jar avi
Give that a whirl.
Simon
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64190
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's what I've customarily done and never has any problems.
bear
 
Noah Sager
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<evil laugh>IT'S ALIIIIIIIIIIIIIIIVE!!!</evil laugh>
Thank you so much Simon. That's been the problem all along. The book said NOTHING about jarring the classes, even for the PC.
Now I can code and run my assignments at home. Thanks so much, guys.
And thank you Rob and Bear for helping out.
Noah
 
Rob Ross
Bartender
Posts: 2205
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad to be of help. Good call on the Jar issue Simon. That totally slipped my mind.
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic