can't run any code now.. java error? (NumberFormatException.forInputString)

edited December 2015 in Using Processing

i can't run any processing code now....even basic examples.. the console say:

Exception in thread "Thread-12" java.lang.NumberFormatException: For input string: ""
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:592)
    at java.lang.Integer.parseInt(Integer.java:615)
    at processing.app.Preferences.getInteger(Preferences.java:298)
    at processing.mode.java.runner.Runner.getSketchParams(Runner.java:315)
    at processing.mode.java.runner.Runner.launchVirtualMachine(Runner.java:177)
    at processing.mode.java.runner.Runner.launch(Runner.java:119)
    at processing.mode.java.JavaMode$1.run(JavaMode.java:162)
    at java.lang.Thread.run(Thread.java:745)

i was using 3.0.1 on win7

i have uninstalled Java and reinstalled p3 several times...still not working...

and i followed the instruction on https://github.com/processing/processing/wiki/troubleshooting

i deleted the preferences.txt but now i can't open the preference window by going to File->Preference in processing and the console says:

Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: For input string: ""
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:592)
    at java.lang.Integer.parseInt(Integer.java:615)
    at processing.app.Preferences.getInteger(Preferences.java:298)
    at processing.app.ui.PreferencesFrame.showFrame(PreferencesFrame.java:682)
    at processing.app.Base.handlePrefs(Base.java:1718)
    at processing.app.ui.Editor$17.actionPerformed(Editor.java:776)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2346)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
    at java.awt.Component.processMouseEvent(Component.java:6525)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6290)
    at java.awt.Container.processEvent(Container.java:2234)
    at java.awt.Component.dispatchEventImpl(Component.java:4881)
    at java.awt.Container.dispatchEventImpl(Container.java:2292)
    at java.awt.Component.dispatchEvent(Component.java:4703)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4533)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462)
    at java.awt.Container.dispatchEventImpl(Container.java:2278)
    at java.awt.Window.dispatchEventImpl(Window.java:2750)
    at java.awt.Component.dispatchEvent(Component.java:4703)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

anyone know what to do now??

Answers

  • edited December 2015
    • You may try out older versions.
    • You may try out 32-bit versions too.
    • Don't use Windows' system folders for Processing installations.
    • Prefer something like your Documents or some other place under your control.
    • Don't forget to whitelist Processing in the firewall.
  • still not running even for the 32bit version....

  • That looks like a preference is missing a value.

    NumberFormatException...

    processing.app.Preferences.getInteger...

    A corrupted preferences.txt file?

  • maybe...but how to fix that??

  • the troubleshooting suggests that the preferences.txt file will be recreated if you delete it so try that again.

    post the recreated preferences.txt file here.

  • i have run p3 several times...the preferences.txt wasn't recreated...no file at the original path...

  • edited December 2015

    here's mine, which was successfully recreated when i just tried it.

    NB was recreated on a slightly older version (3.0b7) on linux, so it might not be exactly as needed.

    NB replace the value for sketchbook.path.three near the bottom

    chooser.files.native=false
    console.auto_clear=true
    console.font.size=12
    console.length=500
    console.lines=4
    contribution.backup.on_install=true
    contribution.backup.on_remove=true
    editor.caret.blink=true
    editor.caret.block=false
    editor.completion.auto_close=false
    editor.font.family=Source Code Pro
    editor.font.size=12
    editor.indent=true
    editor.input_method_support=false
    editor.keys.alternative_cut_copy_paste=true
    editor.keys.home_and_end_travel_far=false
    editor.keys.home_and_end_travel_smart=true
    editor.keys.shift_backspace_is_delete=false
    editor.laf=javax.swing.plaf.nimbus.NimbusLookAndFeel
    editor.smooth=true
    editor.tabs.expand=true
    editor.tabs.size=2
    editor.token.comment1.style=#666666,plain
    editor.token.comment2.style=#666666,plain
    editor.token.function1.style=#006699,plain
    editor.token.function2.style=#006699,plain
    editor.token.function3.style=#669900,plain
    editor.token.function4.style=#006699,bold
    editor.token.invalid.style=#666666,bold
    editor.token.keyword1.style=#33997e,plain
    editor.token.keyword2.style=#33997e,plain
    editor.token.keyword3.style=#669900,plain
    editor.token.keyword4.style=#d94a7a,plain
    editor.token.keyword5.style=#e2661a,plain
    editor.token.keyword6.style=#33997e,plain
    editor.token.label.style=#666666,bold
    editor.token.literal1.style=#7D4793,plain
    editor.token.literal2.style=#718a62,plain
    editor.token.operator.style=#006699,plain
    editor.untitled.prefix=sketch_
    editor.untitled.suffix=yyMMdd
    editor.watcher=true
    editor.watcher.debug=false
    editor.watcher.window=1500
    editor.window.height.default=600
    editor.window.height.min=500
    editor.window.width.default=700
    editor.window.width.min=400
    export.application.embed_java=true
    export.application.fullscreen=false
    export.application.stop=true
    export.delete_target_folder=true
    instance_server.key=0.6222273272647838
    instance_server.port=47586
    last.sketch.count=0
    last.sketch.restore=true
    launcher=xdg-open
    mode.last=processing.mode.java.JavaMode
    pdex.autoSave.autoSaveByDefault=true
    pdex.autoSave.autoSaveEnabled=false
    pdex.autoSave.promptDisplay=true
    pdex.autoSaveInterval=5
    pdex.completion=false
    pdex.completion.trigger=false
    pdex.dbgOutput=false
    pdex.errorCheckEnabled=true
    pdex.suggest.imports=true
    pdex.warningsEnabled=true
    pdex.writeErrorLogs=false
    platform.auto_file_type_associations=true
    preproc.color_datatype=true
    preproc.enhanced_casting=true
    preproc.output_parse_tree=false
    preproc.save_build_files=false
    preproc.substitute_floats=true
    preproc.substitute_unicode=true
    preproc.web_colors=true
    proxy.http.host=
    proxy.http.port=
    proxy.https.host=
    proxy.https.port=
    proxy.socks.host=
    proxy.socks.port=
    recent.count=10
    run.display=-1
    run.options=
    run.options.memory=false
    run.options.memory.initial=64
    run.options.memory.maximum=256
    run.present.bgcolor=#666666
    run.present.stop.color=#cccccc
    run.window.bgcolor=#DFDFDF
    sketchbook.path.three=*** YOUR SKETCHBOOK PATH HERE ***
    update.check=true
    update.id=5377505644185493161
    welcome.seen=false
    welcome.show=true
    
  • i created a txt by hand and copied your text...but the same problem still there...same thing in the console...

  • Did you try the thing about adding flags to the startup script to create a logfile?

    Try that and paste the logfile here

  • haven't try that....can you tell more specifically how to do that,please?? or what webpage i can refer to? thanks for your patience....

  • It's the troubleshooting link in your first post.

  • edited December 2015

    i followed the troubleshooting part on p5 github...and got a launch4j.log here's it:

    Version:    3.8
    CmdLine:    C:\Users\user\Downloads\processing-3.0.1-windows32\processing-3.0.1\processing.exe --l4j-debug
    WOW64:      yes
    Working dir:    C:\Users\user\Downloads\processing-3.0.1-windows32\processing-3.0.1\.
    Bundled JRE:    java
    Check launcher: C:\Users\user\Downloads\processing-3.0.1-windows32\processing-3.0.1\java\bin\javaw.exe (OK)
    Heap -Xmx:  Requested 256 MB / 0%, Available: 4408 MB, Heap size: 256 MB
    Add classpath:  lib\pde.jar
    Add classpath:  core\library\core.jar
    Add classpath:  lib\jna.jar
    Add classpath:  lib\antlr.jar
    Add classpath:  lib\ant.jar
    Add classpath:  lib\ant-launcher.jar
    Add classpath:  lib\org-netbeans-swing-outline.jar
    Add classpath:  lib\com.ibm.icu_4.4.2.v20110823.jar
    Add classpath:  lib\jdi.jar
    Add classpath:  lib\jdimodel.jar
    Add classpath:  lib\org.eclipse.osgi_3.8.1.v20120830-144521.jar
    Launcher:   C:\Users\user\Downloads\processing-3.0.1-windows32\processing-3.0.1\java\bin\javaw.exe
    Launcher args:  -Xmx256m -Djna.nosys=true -Djna.boot.library.path=lib -Djna.nounpack=true -classpath "lib;lib\pde.jar;core\library\core.jar;lib\jna.jar;lib\antlr.jar;lib\ant.jar;lib\ant-launcher.jar;lib\org-netbeans-swing-outline.jar;lib\com.ibm.icu_4.4.2.v20110823.jar;lib\jdi.jar;lib\jdimodel.jar;lib\org.eclipse.osgi_3.8.1.v20120830-144521.jar" processing.app.Base
    Args length:    351/32768 chars
    Exit code:  259
    
  • (it's a good idea if you're posting lists of things or output to format it as code for the forum - highlight and hit ctrl-o. otherwise it gets displayed as one big paragraph and the symbols get translated into markup and it looks a mess)

    anyway, nothing looks obviously wrong in the above log, but then i don't know windows 7

    is the path really "C:\Users\user..." or have you anonymised it? the classic problem is a space or non-ascii characters in the path...

Sign In or Register to comment.