Compiling on Mac OS X

This forum is used to discuss questions and details regarding the AVRcamVIEW PC application.

Compiling on Mac OS X

Postby rburns » Tue Feb 01, 2005 6:55 pm

Hello,

After lots of "fun" getting rxtx installed and working, I managed to get AVRcamVIEW mostly compilied. Im down to one error:

./avr/swing/JMessagePanel.java:52: putClientProperty(java.lang.Object,java.lang.Object) in javax.swing.JComponent cannot be applied to (java.lang.String,boolean)

For fun I commented this line out and created a jar, but when I try to run the jar I got this:

Failed to load Main-Class manifest attribute from
AVRCamView.jar

I don't have much experience with Java, but it seems there may be a component missing from the source.

Any Ideas on these 2 issues?
OS X is using Java 1.4.2, no 1.5 yet :(

Thanks,
Ryan

PS. I would really like it if there existed a pre-built version for 1.4
What ever happened to Java being portable?
rburns
 
Posts: 7
Joined: Fri Jan 14, 2005 11:44 pm

Re: Compiling on Mac OS X

Postby rgaimari » Tue Feb 01, 2005 9:40 pm

rburns wrote:./avr/swing/JMessagePanel.java:52: putClientProperty(java.lang.Object,java.lang.Object) in javax.swing.JComponent cannot be applied to (java.lang.String,boolean)


I believe that the line causing the problem is:

closeB.putClientProperty("paintActive", true);

"true" is a boolean, not an Object. That's what is causing the problem; putClientProperty is expecting it's two arguments to be Objects. The first already is (a String). To make them both Objects, try:

closeB.putClientProperty("paintActive", new Boolean(true));

Now that you refresh my memory, I think I had this problem when I did the recompile, too. This should fix it.

- Bob
rgaimari
 
Posts: 3
Joined: Tue Nov 30, 2004 2:41 pm

AVRcam now works on OS X

Postby rburns » Wed Feb 02, 2005 10:24 pm

Hi,

Thanks for the help. Changing "true" to "new Boolean(true)" worked, AVRCamView now compiles correctly.

After a bit more work, I copied the manifest.mf file from the released jar, and I included build.properties and avr.properties in resources, and now AVRCamVIEW compiles and runs!

Im super excited. I also finished a C library for interacting with the camera.

Thanks again,
Ryan
rburns
 
Posts: 7
Joined: Fri Jan 14, 2005 11:44 pm

Postby Bud » Wed Feb 02, 2005 11:10 pm

Thanks for your response Bob. Because I'm using JDK 1.5, the compiler boxes (inserts the code to create an object from a primitive type) the "true" primitive type to a Boolean type. This is why you have to use the following line if you are not using JDK 1.5
Code: Select all
closeB.putClientProperty("paintActive", new Boolean(true));

I have changed my code so that you can compile it under JDK 1.4.

I also realized that my ant build script did not make it into the source zip file. That will be added to the next release of the AVRcam software.

Ryan, could you send me the files and instructions for getting the rxtx working on a MAC so I can add it to the distribution CD for the AVRcam. (taylorba@comcast.net)

With regards to the AVRCamView.jar file you were trying to run, was that the one you built or the one shipped on AVRcam CD? If you built the jar file, you have to add a manifest file that contains the line:
Code: Select all
Main-Class: avr.swing.JAVRCamFrame

Then to create the jar file issue the following command:
Code: Select all
jar -mf manifest AVRcamView.jar classes

The next release of the AVRcamView will be made public next week along with a new version of the AVRcam embedded software.

-- Bud
Bud
 
Posts: 9
Joined: Sun Dec 12, 2004 5:37 pm


Return to AVRcamVIEW PC Application

Who is online

Users browsing this forum: No registered users and 2 guests

cron