JDK. DIO with Java SE instead of Java ME

Sorry for posting in the Java ME Community. It's really a question SE with libraries of jdk.dio me.

After my problems not solved with opening/dev/servoblaster pipe of Java ME (see my other post), I went to Java SE and added jdk.dio, netbeans libraries both on IP to raspberries.

Opening servoblaster works very well but now a new problem:

I am trying the same code that worked perfectly in Java ME to open a GPIO PIN for entries, as shown below. Doing this in Java SE with jdk.dio causes a nullpointerexception on the last statement when I try to check if the PIN is open. I get the same error when I try to set a value for the axis. No error message on the declaration of DeviceManager.open.

Because it works without problem in the Java ME environment, that I suspect is has something to do with the installation of the remote device and the related authorizations.

I SE the remote device configuration is different and I think I don't see approval in the same way as for a Java ME embeddeddevice. In netbeans, I defined the Pi as a platform for remote execution and during the generation, it connects and compile without problem.

Permissions, I put on the invoice, pro forma. Since I found the safety instructions fairly clear, I added GPIOPin GPIOPort and DeviceMgmt permissions to several folders (better safe than sorry :-))

/dev/test/Java.policy

usr/lib/JVM/JDK-8-Oracle-ARM-VFP-hflt/jre/lib/security/java. Policy

/ HOMR/pi/NetBeansProjects/MyProjectName/dist/GPIO. Policy

but it does make a difference.

I've also set the pins GPIO B + extra in /dev/config/dio.properties-raspberrypi

No idea why it does not work? All advice appreciated.

Kind regards

Willem

code used:

GPIOPinConfig config2 = new GPIOPinConfig (portID, 12, GPIOPinConfig.DIR_INPUT_ONLY, DeviceConfig.DEFAULT, GPIOPinConfig.TRIGGER_BOTH_EDGES, false);

try {}
HCSR04Receive = DeviceManager.open (config2);
} catch (IOException ex) {}
Logger.getLogger (hcsr04me.class.getName ()) .log (Level.SEVERE, null, ex);
}

System.out.println (HCSR04Receive.IsOpen ());

Thank you

I solved it myself a minute ago.

I found this article: https://www.voxxed.com/blog/2014/12/device-io-api/ and then followed step by step, applying to my project.

He ran my project without problem and between listing 3 and 4, he copy a number of files with the command cp - r/build/deviceio/lib / * home/pi / $ JAVA_HOME/jre/lib (although you need to run it as sudo and it only says not in the instructions).

After that she also connected my NetBeans project, so I guess that these missing files caused problems.

So now I'm going to continue my project using:

  • Java SE in order to open/dev/servoblaster, which is not possible in Java ME
  • using PI4J with WiringPi libraries for implementing good implementation of the software PWM
  • using the jdk.dio for any other control gpio libraries

Thank you

Willem

Tags: Java

Similar Questions

  • is there a version of the ESS with Java 7?

    as we need to use TLS 1.2, is there a version of the ESS with Java 7?

    No, but the supports IBM JDK TLS 1.1 and 1.2 in Service r 10

    IBM SDK, Java Technology Edition, Version 6, Service r 10

    Service update 10 security updates include support for protocols TLS 1.1 and TLS 1.2 and support elliptic curve and the AES - GCM cipher suites.

  • 4.1 Why complain with java version 1.8.0_31?

    Hi all

    Decided to share this, as it seems a little strange to me, and Googling for this error does not return useful results.

    objective: installation of the sql 4.1 with jdk 1.8 developer

    EDIT: adding download links

    1. downloaded: jdk-8u31-windows - x 64 .exe [a Java SE Development Kit 8 - downloads - Windows x 64 - http://download.oracle.com/otn-pub/java/jdk/8u31-b13/jdk-8u31-windows-x64.exe ]

    2. downloaded: sqldeveloper - 4.1.0.17.29 - no - jre.zip [a SQL Developer 4.1 early adopter -Windows 32/64 - bit - http://download.oracle.com/otn/java/sqldeveloper/sqldeveloper-4.1.0.17.29-no-jre.zip ]

    3 extracts sqldeveloper - 4.1.0.17.29 - no - jre.zip in the folder xpto

    4. run sqldeveloper.exe and set the folder of jdk for the installation of step1 folder got - it's C:\Program Files\Java\jdk1.8.0_31

    5 WARNING strange message complaining that sql developer oracle 4.1 not been certified with java 1.8.0_31! Seriously ?

    sqldeveloepr4.1--java1.8 error.png

    The PC is not mine, and I noted several java.exe in certain directories to spread with no set env vars. Anyway the only thing I think is important for sql developer is the physical path that we provide, so im really puzzled why the oracle Web site recommends version of the jdk for oracle sql developer 4.1 1.8 is rejected when I try to install it

    See you soon,.

    Zen

    because, bug

    We forgot to set a flag in the generation process which would ensure that it is looking for 8

    You want to, must have JDK8 with v4.1

    Just say 'Yes' and continue.

    This bug has been fixed for the next early adopter.

  • 20.0 unusable. Each click generates a Java pop up, even with Java disabled error.

    JavaScript application ' error: missing (after for) "pop - up occurred during every change of page, sometimes 2 or 3 on the other. Even with Java removed or disabled. Even with the blocker on. Browser reinstalled several times.

    Hello, you can try to reproduce this behavior when you start firefox in safe mode, once? If not, perhaps an addon intrudes here...

    Troubleshoot extensions, themes, and issues of hardware acceleration to resolve common problems of Firefox

  • problem with java and pogo games

    I use mozilla, and now with the problems with java and hackers cannot play my pogo, what can I do? I disabled my java I tried java 6 does not work or is not safe, what is a safe way to play games on pogo using java?

    Pogo.com is determined as a website SAFE to use Java with Mozilla Firefox?

  • When I start my online banking, the options do not load. I get a message that the applet is not started because it has not been initialized (I think it has to do with Java). What should I do?

    I go on my site of the Fund and go to my accounts. And I can get into my account. But the menu that allows you, among other things, go to the online banking is not. Keep it from the page it says "start applet" and then immediately "uninitialized applet." How as it initialized? I think, but am not really sure that it has something to do with Java.

    To see if you need an update to the Java plugin, see the Oracle here test page:

    http://www.Java.com/en/download/testjava.jsp

    Who help me?

  • Problems with Java games Sites

    I have java installed on my computer, when I go to the gaming sites they say I don't have it. Their site brings me to the Java site for re install I have. I do and I still get the same results. Frustrating. I did the Java offline also and that no longer works. I checked that it is also enabled.

     

    Hello

    It seems that you are facing problems with Java during the visit of the gaming sites.

    1. This problem occurs on all the gaming sites?
    2. Other sites work well?
    3. What is the operating system installed on the computer?

    You can Remove all existing versions of Java on the computer and reinstall the last being. We know the result.

    Also see this link for more information.

    Thank you.

  • Downloaded and paid of Minecraft and having problems with Java, Anti Virus Scan and Windows Update - error code 800F081F

    Downloaded and paid of Minecraft and having problems with Java, Anti Virus Scan and Windows Update - error code 800F081F

    Would you advice, thank you.

    Hi Hugo,.

    1. what anti-virus software you have installed in the computer?

    2. What is the full error message/code?

    3. the issue occurred after you install Minecraft?

    4. are you able to play Minecraft without any problem?

    5. what happens with Antivirus and Java?

    Windows Update can occur if one or more of the following conditions are met:

    1. the Windows Update database is damaged.

    2. antivirus software is configured to scan the %Windir%\SoftwareDistribution folder.

    3. the service (BITS) Background Intelligent Transfer Service does not receive a content link header.

    4. a required system file is incorrectly registered.

    5. Windows Installer has encountered an error.

    6. the manifesto of component maintenance (EC) is damaged.

    7. the Windows Update service has stopped during the installation.

    8. a version of the file conflict exists with Windows Update agent files.

    Please follow the steps described in the methods to solve the problem:

    Method 1: We will try the steps from the following link and check the result:

    Important: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article:http://windows.microsoft.com/en-US/windows7/Back-up-the-registry

    How to reset the Windows Update components?

    http://support.Microsoft.com/kb/971058?WA=wsignin1.0

    Method 2:

    To correct the errors that occur when you use Windows Update, install, and run the system update readiness tool. The tool analyzes inconsistencies on your computer and fixes as its current installation.

    You can view the following link to download the system update readiness tool and check:

    System tool update that corrects problems of Windows Update is available for Windows 8, Windows 7, Windows Vista, Windows Server 2008 R2 and Windows Server 2008

    http://support.Microsoft.com/kb/947821

    Details of the event log to find what caused the Antivirus and Java to fail:

    What are the information contained in the logs of the event (Event Viewer)?

    http://Windows.Microsoft.com/en-us/Windows7/what-information-appears-in-event-logs-Event-Viewer

    Hope that the information provided is useful.

    For any help related to this problem or any question of Windows, you can still display in the Microsoft Community Forum!

  • With the help of EQ with Java 7 Workgroup Manager

    Oracle is declining in favour of Java 6. How can I get Bishop Grp to work with java 7? I have a 5000 PS to fw version 6.02.

    Thank you.

    It's something on the browser side OS.   What browser do you use?  The Web page sees that it is a java applet and call Java Runtime on the host computer.

    I would like to clear the cache from my browser and java and try again.

  • Is - this windows 7 comes with java?

    Windows 7 comes with Java?

    I read somewhere that it is, and I know for certain that windows vista does.

    I know how to install java (java.com/getjava).

    I had 6 JRE Java running on vista, but now that I've upgraded to windows 7, it seems that I have no JVM at all.

    No, Windows 7 includes not Java, you'll have to download it from the site Web of SUN Microsystems.
    How do I manually download and install Java for my Windows computer? Andre Da Costa http://adacosta.spaces.live.com http://www.activewin.com

  • Yahoo Sitebuilder will not work with Java 7.

    I have been using Yahoo Sitebuilder for years without any problem.  Now that my system (Windows 7) updated for Java 7 Sitebuilder doesn't work anymore.
    I uninstalled Java 7 and re-installed Java 6.  This seems to fix the problem for a day, then Java itself once more updated Java 7 and I have the same original problem with Yahoo Sitebuilder.  BTW... it says on the site of Sitebuilders that is compatible with Java 7 and yet when you download the new version of Yahoo Sitebuilders, Java 7 is installed.   Can someone help me?  I need to update my site.
    Thank you

    Hi Mary,

    I suggest you contact the Yahoo Support for assistance on this issue.

    Using Yahoo! SiteBuilder

    Customer support

    It will be useful.

  • Problem with opening files and demand, everything opens with Java.

    I think I clicked the wrong application to open a file and now all the application and the files are open with Java (TM) Platform SE binary.

    And now I do not know how is back to normal.

    Please help me with this problem.

    Hello

    This should help you.

    'Restore. Association of exe in Windows 7/Vista after incorrectly associating it with another program"

    http://www.Winhelponline.com/blog/restore-exe-file-Asso-Windows-7-Vista-incorrectly-associated/

    "When you run an .exe on a Windows XP, Windows Vista or Windows 7 computer file, the file can start another program.

    Run the Mr.Fixit here or you can use the manual method it y to correct yourself

    http://support.Microsoft.com/kb/950505/en-us

    And also, read information please.

    'Change the programs that Windows uses by default'

    http://Windows.Microsoft.com/en-us/Windows7/change-which-programs-Windows-uses-by-default

    See you soon.

  • I HAVE WIN 7 64-BIT, MOZILLA FIREFOX IS MY BROWSER HASVING PROBLEMS WITH JAVA CAN HELP PLEASE

    I HAVE WINDOWS 7 64 BIT LAP TOP, I'M WITH MOZILLA FIRE FOX AS MY BROWSER, HAVING PROBLEMS WITH JAVA... WHICH SHOULD I USE? ALSO CAN I HAVE THE WINDOWS PHOTO VIEWER TO OPEN FILES

    First; There, please do not type in uppercase.  It is considered rude and make your post less readable.

    The version of Java to use depends on the browser.  Firefox is a 32-bit browser therefore uses the 32-bit version of Java.
    Internet Explorer, for example, has a 32-bit and 64-bit version in Windows 7, the two versions of Java may apply depending on whether you are using.

    The Windows Photo Viewer can open different types of graphic files, what is the problem?

  • Problems with Java and Internet Explorer9

    Bought this Compaq Presario in August 2011 with IE8 in it without any problem.  October or November, updates installed IE9 and since then I have had problem with Java on IE9.  Mainly with the signature in some sites mainly Pogo (don't remember the others).  Checked in the Java Control Panel under Advanced and browsers only IE and Firefox are indicated (although I also have Chrome).  IE and Firefox are archived for Java, but while Firefox is written in dark letters, IE is gray and I can't it darkened.  Even when I switched browsers default to IE, it is always grey.  I already follow the article on Pogo and Java problems and I have no problem with Firefox or Chrome, only Internet Explorer.

    Thank you

    Spock

    Why Microsoft Internet Explorer 9 hang after that I have visits a web page with Java applets?
    http://www.Java.com/en/download/help/iecrash.XML

    Install Java in Windows Internet Explorer 9
    http://Windows.Microsoft.com/en-us/Windows7/install-Java-in-Internet-Explorer-9

    Use Reset Internet Explorer settings (RIES)
    http://support.Microsoft.com/kb/923737#appliesTo

    You see the same problems if you test with another Windows user?

    You are running version 64 bit or 32 bit IE 9?  Even if you're a machine 64-bit by default IE 8 or 9 should be the 32-bit version.  This is the version that runs on 64-bit computers by default.  If you use this version, then the problems would disappear.

    Questions: 64 - Bit Internet Explorer
    http://blogs.msdn.com/ieinternals/archive/2009/05/29/q-a-64-bit-Internet-Explorer.aspx

  • Windows 7 starter edition does not work with Java 7 (unable to load the chat room) how to fix?

    Hello

    I have Windows 7 edition - starter and Java 7 when I try to use a school chatrooom - java won't load properly - tech school says it's because Windows 7 does not support Java 7 - any ideas on how to fix?
    THX,
    Maja

    If he believes that the school needs to get a new technology.

    To check if the problem is that the cat does not work with Java 7, uninstall Java 7 and install Java JRE 6 from here:

    http://www.Oracle.com/technetwork/Java/javase/downloads/index.html

    You must specify the exact error messages see you or post links on the screenshots so that your problem can be better understood.

Maybe you are looking for