1

I am trying to use a Java application on Windows 7 called "ldraw2sunflow". It converts between two 3D model formats. The program is described here. Anyway, the program ran the first time I tried it, but now ceases to run.

This is strange because the program has worked properly in the past.

Here is the error:

Jan 31, 2018 3:27:49 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0
x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Jan 31, 2018 3:27:49 PM org.ldraw2sunflow.ui.Ldraw2Sunflow <init>
INFO: en_US
Exception in thread "AWT-EventQueue-0" java.lang.StringIndexOutOfBoundsException
: String index out of range: -1
        at java.lang.String.substring(Unknown Source)
        at org.ldraw2sunflow.util.PartFinder.loadColor(PartFinder.java:274)
        at org.ldraw2sunflow.util.PartFinder.setLDRAWDIR(PartFinder.java:172)
        at org.ldraw2sunflow.ui.impl.LDrawPanel.initPreferences(LDrawPanel.java:122)
        at org.ldraw2sunflow.ui.impl.LDrawPanel.<init>(LDrawPanel.java:47)
        at org.ldraw2sunflow.ui.Ldraw2Sunflow.<init>(Ldraw2Sunflow.java:80)
        at org.ldraw2sunflow.ui.Ldraw2Sunflow.lambda$main$10(Ldraw2Sunflow.java:114)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$500(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)

Two questions:

  1. What is causing the error?
  2. Can I fix this problem without having the source code?

Thanks.

[edit]

Here is my command line: "C:\Program Files\Java\jre1.8.0_161\bin\java.exe" -Xmx1G -jar "E:\Programs Windows\LDraw\LDraw2Sunflow_f\ldraw2sunflow.jar"

[edit]

I suspect it is some type of registry issue, since when I delete "HKEY_USERS\S-1-5-21-2113055238-2099637611-63920502-1003\Software\JavaSoft\Prefs\org" using regedit, the program will start again. However the stored library paths are missing when I restart the program, so I have to type them in again. (And again, and again, and again, each time I stop/start the program.)

The actual program is failing somewhere else now:

Exception in thread "Thread-4" java.lang.UnsatisfiedLinkError: no lwjgl in java.
library.path
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at org.lwjgl.LWJGLUtil.loadLibrarySystem(LWJGLUtil.java:337)
        at org.lwjgl.Sys.<clinit>(Sys.java:29)
        at org.ldraw2sunflow.lwjgl.PreviewOpenGL.run(PreviewOpenGL.java:160)
        at org.ldraw2sunflow.ui.impl.RenderPanel.convertFile(RenderPanel.java:11
7)
        at org.ldraw2sunflow.ui.impl.RenderPanel.access$000(RenderPanel.java:61)

        at org.ldraw2sunflow.ui.impl.RenderPanel$1.run(RenderPanel.java:85)
0

1 Answer 1

1

It's known Java problem.

1. First step:

If you running your program like this:

java -jar ldraw2sunflow.jar

add full path to both files, something like:

/usr/java/<version>/bin/java -jar /home/<username>/Downloads/ldraw2sunflow.jar

2. Second step:

For Windows 7:

  1. Start "Control Panel"
  2. Click "Default Programs"
  3. Click "Associate a file type or protocol with a specific program"
  4. Double click .jar
  5. Browse C:\Program Files\Java\jre1.8.0_161\bin\javaw.exe
  6. Click the button Open
  7. Click the button OK

3. Last step:

Convert jar to exe. Anyway you'll need JRE to run it, but it will be 100% runnable. There many variants of such converters. Formerly I used jar2exe.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .