import java.util.Scanner not working with codenameone

1

I try looking online for solution, but couldn't find one. It my first time using codenameone , why does import java.util.Scanner doesn't work with codenameone project in eclipse? I know the JAVA_HOME path is good and everything is updated.

WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.

java
codenameone
asked on Stack Overflow Feb 27, 2017 by LooperBoy

1 Answer

1

This is a common issue with a freshly installed Java on windows, you can solve this by doing the following:

  1. Go to your Start Menu and type regedit into the search field.
  2. Navigate to path HKEY_LOCAL_MACHINE\Software\JavaSoft (Windows 10 seems to now have this here: HKEY_LOCAL_MACHINE\Software\WOW6432Node\JavaSoft)
  3. Right click on the JavaSoft folder and click on New -> Key
  4. Name the new Key Prefs and everything should work.

Alternatively, create a new file named java.reg with the following content and execute it:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\Software\JavaSoft\Prefs]
answered on Stack Overflow Feb 27, 2017 by Diamond • edited Feb 27, 2017 by Diamond

User contributions licensed under CC BY-SA 3.0