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

Execution on ide not possible #1

Closed
vincenzopalazzo opened this issue Nov 6, 2018 · 5 comments
Closed

Execution on ide not possible #1

vincenzopalazzo opened this issue Nov 6, 2018 · 5 comments

Comments

@vincenzopalazzo
Copy link

Hello,

I took a look at your project and I like the idea, I would like to open it with my ide and without the file of setting.json this is not possible and it is a bit difficult for me to rebuild it, it's not that you can solve this problem ?

Also I tried to download the zip file containing the executables but I'm not going to extract it correctly raises an error, I thought it was my problem but trying to extract the zip that generates github for the download of the project the problem does not persist.
Can you solve this problem too so I can try your project?

@user12043
Copy link
Owner

user12043 commented Nov 7, 2018

Hi,
The existence of "settings.json" file should not be a problem. I tried to download the code and open the project with my IDE (with Intellij IDEA) but there was no problem. Why it is not possible to open the project without the settings file? (Intellij idea is recognizing the maven project with pom.xml file.)

I downloaded zip file contains the executables and executed the program successfully. So could give more information about your error? I compressed and extracted the executables with 7-zip on windows and opened with "Ark" on linux also.

Thanks for your interest

@vincenzopalazzo
Copy link
Author

Hello @user12043 ,
sorry I'm bad, I'll post my mistakes that I found.
screenshot from 2018-11-07 23-10-53

screenshot from 2018-11-07 23-18-59

Also it would not be easier to post executables directly without zipping them?

@user12043
Copy link
Owner

user12043 commented Nov 8, 2018

Hello @vincenzopalazzo
Now I understand the problem about JSONException In below function from ogr.user12043.jpomotimer.Utils

public static void loadSettings() {
        try {
            String fileContent = readSettingsFile();
            JSONObject jsonObject = new JSONObject(fileContent);
            // Some code here...
        } catch (IOException | JSONException e) {
            System.err.println("Failed to read settings file. Using default settings.");
            e.printStackTrace();
        }
}

The readSettingsFile() function returns an empty string if the file does not exists. Then fileContent becomes "". Because of this, new JSONObject(fileContent) throws JSONException and this exception is catching by catch block. So this exception is not blocking the program. Just printing the error with the line e.printStackTrace(). So the problem is not actually a problem. But I think the program should not print the exception to stdout and I edited the code and committed now.

And about the error when you trying the unzip the binaries, the archive created with 7-zip on windows, I am using Linux as you and I am getting the same error An error occurred when extracting files on some .zip files. But I successfully extracted my executables without this error. I haven't any solution about the error. So I uploaded the tar.gz archive of the binaries of my project. This should help you.

@vincenzopalazzo
Copy link
Author

Hello @user12043 ,

Sorry for the delay, I made a bit of confusion, sorry having seen the code I understand how it works.

Thanks for uploading the tar file this solved my problem

@user12043
Copy link
Owner

I appreciated, thank you for your interest. Closing the issue

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

2 participants