Building Pi4J on Netbeans

77 views
Skip to first unread message

GeertVc

unread,
Mar 28, 2015, 2:32:44 PM3/28/15
to pi...@googlegroups.com

I've been able to completely compile Pi4J using Netbeans 8.0.2 on Windows XP, Home Edition, SP3. 

There's one package, however, that keeps on indicating that there are issues: Activator.java in the package com.pi4j.service.osgi.

I've taken a screen shot of it, pls. find it below:


However, the overall build result of Pi4J says "BUILD SUCCESS".  See screenshot below:

This is a contradictionary situation, which I can't explain (Maven is anyhow new to me and I've not been able so far to run the Maven command line commands, as explained in the Pi4J package...).




GeertVc

unread,
Mar 29, 2015, 8:54:47 AM3/29/15
to pi...@googlegroups.com
In the mean time, I'm able to run Maven from the command line.  All builds fine, including the "suspicious" file.

Reason why I couldn't run Maven from the command line was that my JAVA_HOME env var was pointing to JDK 1.6 (which I still need for other purposes).  I've now changed it so that it points to JDK1.8 and all goes fine.

But still, why this issue in Netbeans...

Robert Savage

unread,
Mar 31, 2015, 8:00:01 PM3/31/15
to pi...@googlegroups.com

Removing the useless (unused) properties object seems to fix the issue in Netbeans.  
Basically the "Properties" class was not implementing the Dictionary<String,?> interface expected by the registerService() method.  

 
   @Override
   
public void start(BundleContext bundleContext) throws Exception
   
{
       
// create a new GPIO service instance
       
// and register services with OSGi
        bundleContext
.registerService(GpioService.class.getName(), new GpioServiceImpl(), null);
        bundleContext
.registerService(SystemInformationService.class.getName(), new SystemInformationServiceImpl(), null);
        bundleContext
.registerService(NetworkInformationService.class.getName(), new NetworkInformationServiceImpl(), null);        
   
}


Thanks, Robert
Reply all
Reply to author
Forward
0 new messages