Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message with no map #7

Closed
123mind123 opened this issue May 9, 2020 · 4 comments
Closed

Error message with no map #7

123mind123 opened this issue May 9, 2020 · 4 comments

Comments

@123mind123
Copy link

Error message says "unable to read word dictionary file" after pressing Generate.

@123mind123
Copy link
Author

If I turn off text it says "no awt in java.library.path"

@jeheydorn
Copy link
Owner

jeheydorn commented May 9, 2020 via email

@jbylicki
Copy link

It might be an encoding issue.
It is set in the source to use Charset.defaultCharset() as the default character set, probably assuming it is going to be UTF-8. And for me it was in fact, this test code's output is: The default charset of the machine is :UTF-8

The test code:

import java.nio.charset.Charset;
public class test {
  
    public static void main(String[] args)
    {
        Charset cs = Charset.defaultCharset();
        System.out.println("The default charset of the machine is :" + cs.displayName());
    }
}

However I still got an error like this:

Starting
java.lang.RuntimeException: Unable to read word dictionary file.
	at nortantis.NameCompiler.<init>(NameCompiler.java:52)
	at nortantis.TextDrawer.<init>(TextDrawer.java:112)
	at nortantis.MapCreator.createMap(MapCreator.java:102)
	at nortantis.RunSwing$3$1.doInBackground(RunSwing.java:380)
	at nortantis.RunSwing$3$1.doInBackground(RunSwing.java:1)
	at java.desktop/javax.swing.SwingWorker$1.call(SwingWorker.java:304)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.desktop/javax.swing.SwingWorker.run(SwingWorker.java:343)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.nio.charset.MalformedInputException: Input length = 1
	at java.base/java.nio.charset.CoderResult.throwException(CoderResult.java:274)
	at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
	at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:188)
	at java.base/java.io.InputStreamReader.read(InputStreamReader.java:177)
	at java.base/java.io.BufferedReader.fill(BufferedReader.java:162)
	at java.base/java.io.BufferedReader.readLine(BufferedReader.java:329)
	at java.base/java.io.BufferedReader.readLine(BufferedReader.java:396)
	at java.base/java.nio.file.Files.readAllLines(Files.java:3415)
	at nortantis.NameCompiler.<init>(NameCompiler.java:49)
	... 10 more

After adding -Dfile.encoding=UTF-8 to java's arguments, it has worked flawlessly. The final command is: java -XX:MaxRAMPercentage=50.0 -Dfile.encoding=UTF-8 -jar nortantis_map_generator.jar
I'd suggest adding it if it causes no external problems, or at least leave that message in the issue in case someone stumbles in here with the same problem. Cheers and thanks for the awesome work with this generator

@jeheydorn
Copy link
Owner

Thanks for investigating this. I went ahead and made the changes you suggested in the run files for Windows and Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants