Bringamosa
Posts: 13
Joined: Sat Aug 04, 2018 12:15 am

How to get GUI to show

Sat Aug 04, 2018 12:22 am

Hi all.

I have a .jar program that runs smoothly on windows. If i double click the file it opens a GUI and i can use the program.

However when i try to run the file on my rpi 3 it will not open the GUI. I tried double clicking it and nothing happens.

When i try to run it using this command: java -jar filename.jar
i get this response:

Code: Select all

4-aug-2018 1:52:47 config loaded
4-aug-2018 1:52:47 failed to create GUI:
4-aug-2018 1:52:47 java.lang.reflect.InvocationTargetException
	java.awt.EventQueue.invokeAndWait(EventQueue.java:1349)
	java.awt.EventQueue.invokeAndWait(EventQueue.java:1324)
	traviaut.Main.main(Unknown Source)
4-aug-2018 1:52:47 TraviAut
4-aug-2018 1:52:47 Version: 20180307.0
4-aug-2018 1:52:47 Java version: 1.8.0_181
4-aug-2018 1:52:47 TO AVOID CAPTCHA FILL IN YOUR USER_AGENT IN SETTINGS
How do i get the "failed to create GUI" error fixed?

I hope you can help me out here if more info is needed please let me know and i will provide.

User avatar
B.Goode
Posts: 8274
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: How to get GUI to show

Sat Aug 04, 2018 7:15 am

Welcome to the Raspberry Pi forums.


Perhaps this is a question that should be addressed to the author of the application you are trying to run?



But just as a guess... From http://www.traviaut.com

Getting started in 3 easy steps
Click settings and fill in your User Agent. You can get your User Agent here
That seems to correspond with the text emitted by the application -
TO AVOID CAPTCHA FILL IN YOUR USER_AGENT IN SETTINGS


Have you done that?

Bringamosa
Posts: 13
Joined: Sat Aug 04, 2018 12:15 am

Re: How to get GUI to show

Sat Aug 04, 2018 7:52 am

Hi thank you for looking at my problem.

I have contacted the author too waiting for a response still. I have had it working on lubuntu like a year back or so i thought it would work on rapsbian too.

About filling in the user agent, that is the message the application will show in the GUI when running it. I'll hav a look and see if i can find where it is saved.

PiBurner
Posts: 23
Joined: Wed Mar 23, 2016 2:34 pm

Re: How to get GUI to show

Thu Apr 18, 2019 1:13 am

There's something wrong in you app.
Once you get it working in a terminal window with 'java -jar /path to the jar file/program name.jar', you can make it and other jar files launch with a double click this way:

To set association for java .jar files so you can double click on it and launch, do the following:

Click on the start raspberry and select Preferrences>Main Menu Editor
pick a the 'Other' menu location on left side
click on new item
type in name you want displayed (I used ' Java Start ')
for command, use ' /usr/bin/jexec %f ' (no quote marks or spaces at beginning or end)
do not click on Launch in Terminal
click on OK
new name used should show in list on right and checked to use
click OK to finish
right click on the jar file and select 'Open With'
expand the 'Other' category
click on the new item name
set check box for 'Set selected application as default action for this file type' at the bottom
click on OK and the jar file should launch.
double clicks on any jar file will now launch it.
Java Start (or whatever you named it) will show as an option when you right click the jar file, also.

More: viewtopic.php?f=81&t=214974&p=1457136#p1457136
Last edited by PiBurner on Thu Apr 18, 2019 3:04 pm, edited 1 time in total.

Bringamosa
Posts: 13
Joined: Sat Aug 04, 2018 12:15 am

Re: How to get GUI to show

Thu Apr 18, 2019 5:38 am

In the end i had to install something and the problem was solved.

sushant_ocv
Posts: 15
Joined: Mon May 20, 2019 8:14 am

Re: How to get GUI to show

Fri May 31, 2019 5:24 am

Bringamosa wrote:
Thu Apr 18, 2019 5:38 am
In the end i had to install something and the problem was solved.
Happy to see your problem solved.

Return to “Java”