Why no one has answer for java.awt.AWTError: Can't connect to X11 window server using ':0.0' as the - unix

In my local Unix Ubuntu env I keep getting an error as
java.awt.AWTError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
I tried all the below options
1)-Djava.awt.headless
2) installed xvbf.
3) export DISPLAY=:0.0
I also gave command line as
./katalon -runMode=console -projectPath="/home/jenktran/Automation/Katalon First Proj/Katalon First Proj.prj" -retry=0 -testSuitePath="Test Suites/TimesheetTestCaseForChrome" -browserType="Chrome (headless)"
./katalon -runMode=console -projectPath="/home/jenktran/Automation/Katalon First Proj/Katalon First Proj.prj" -retry=0 -testSuitePath="Test Suites/TimesheetTestCaseForChrome" -browserType="Chrome (headless)" ---Djava.awt.headless
What else i can do?

Try the command
$xhost +
This will disable the access control and allows any client to connect

Related

AutoIt Scripting for an External CLI Program - eac3to.exe

I am attempting to design a front end GUI for a CLI program by the name of eac3to.exe. The problem as I see it is that this program sends all of it's output to a cmd window. This is giving me no end of trouble because I need to get a lot of this output into a GUI window. This sounds easy enough, but I am begining to wonder whether I have found one of AutoIt's limitations?
I can use the Run() function with a windows internal command such as Dir and then get the output into a variable with the AutoIt StdoutRead() function, but I just can't get the output from an external program such as eac3to.exe - it just doesn't seem to work whatever I do! Just for testing purposesI I don't even need to get the output to a a GUI window: just printing it with ConsoleWrite() is good enough as this proves that I was able to read it into a variable. So at this stage that's all I need to do - get the text (usually about 10 lines) that has been output to a cmd window by my external CLI program into a variable. Once I can do this the rest will be a lot easier. This is what I have been trying, but it never works:
Global $iPID = Run("C:\VIDEO_EDITING\eac3to\eac3to.exe","", #SW_SHOW)
Global $ScreenOutput = StdoutRead($iPID)
ConsoleWrite($ScreenOutput & #CRLF)
After running this script all I get from the consolWrite() is a blank line - not the text data that was output as a result of running eac3to.exe (running eac3to without any arguments just lists a screen of help text relating to all the commandline options), and that's what I am trying to get into a variable so that I can put it to use later in the program.
Before I suggest a solution let me just tell you that Autoit has one
of the best help files out there. Use it.
You are missing $STDOUT_CHILD = Provide a handle to the child's STDOUT stream.
Also, you can't just do RUN and immediately call stdoutRead. At what point did you give the app some time to do anything and actually print something back to the console?
You need to either use ProcessWaitClose and read the stream then or, you should read the stream in a loop. Simplest check would be to set a sleep between RUN and READ and see what happens.
#include <AutoItConstants.au3>
Global $iPID = Run("C:\VIDEO_EDITING\eac3to\eac3to.exe","", #SW_SHOW, $STDOUT_CHILD)
; Wait until the process has closed using the PID returned by Run.
ProcessWaitClose($iPID)
; Read the Stdout stream of the PID returned by Run. This can also be done in a while loop. Look at the example for StderrRead.
; If the proccess doesnt end when finished you need to put this inside of a loop.
Local $ScreenOutput = StdoutRead($iPID)
ConsoleWrite($ScreenOutput & #CRLF)

R calls mGENOVA-an external Program

Recently I have been trying to use R to call a .exe program named mGenov It's command line program. I have some screenshots to help me explain this (I use Windows 10).
Supposedly, it works this way:
double click on mGenova,
type card.txt
hit "enter" the cmd window will close
I have tried a lot; basically they can invoke the program, but pass the command about typing card.txt in the command
shell(cmd="D:\\mgenova\\mGENOVA\\card.txt", shell="D:\\mgenova\\mGENOVA\\mGENOVA.exe",intern=F)
OR
system("\"D:\\mgenova\\mGENOVA\\mGENOVA.exe\" \"D:\\mgenova\\mGENOVA\\card.txt\""
,show.output.on.console=TRUE,invisible=T,intern=T)
And I always got this
[1] "Input the filename containing the control cards." "" "" "*** Control cards file is empty"
attr(,"status")
[1] 1
Warning message:
running command '"D:\mgenova\mGENOVA\mGENOVA.exe" "D:\mgenova\mGENOVA\card.txt"' had status 1
How can I get it run on it? Thanks for helping!!!!!
You could create a batchfile (let's name it batch.bat) on Windows with the content
cd /D D:\mgenova\mGENOVA\
mGENOVA.exe < card.txt
All necessary input for GENOVA must be provided by the file card.txt.
Then in R run the command
system("batch.bat")

why zsh adds "%" at the end of my output

i'm using zsh on my mac (oh-my-zsh) and i don't understand why at the end of my output there is always this character: "%"
If i don't put export TERM="xterm-256color" in my ~/.zshrc i haven't that character:
Usually a bold % (or # for root) with reversed colors is used to signify a "partial" line in the output. That is a line, which is not terminated with a newline character.
As it seems to depend on the value of TERM I suspect an incompatibility between that value and the settings of terminal emulator. Contrary to the warning shown in your second screenshot, you actually should not set TERM in your ~/.zshrc (or anywhere inside the shell session). TERM should always be set by the terminal emulator itself. Its value (in conjunction with the terminfo terminal capability data base) tells the shell and other programs, which features a terminal emulator supports and how to use them. If the value is changed in the shell, the terminal emulator will not know about it. This may lead to programs sending control codes the terminal emulator does not understand correctly or at all.
In order to change the value of TERM you should change it in the terminal emulator settings. According to the iTerm 2 FAQ the settings is to be found at Preferences->Profiles->Terminal->Report Terminal Type.
I personally placed export PROMPT_EOL_MARK='' inside my ~/.zprofile and hide the character.

display problems of zsh in archlinux

Currently I have installed zsh in archlinux (in gnome 3), and every time when I open the terminal, there are 3 "???" before, then I have to change it manually on the options
Actually I have already set the default locale to UTF-8, and it works in the console before I enter the gnome.But after I enter the gnome interface, it did not work.
After I have changed that, it works, but there is another problem, everytime I type a command and press tab, all the command will be shifted right by 2 words, for example if I type ls, it will display like this:
ls becomes lsls
vim becomes vivim
The first 2 letters cannot be cleared, which is very annoying, can anyone help me about this? Thanks
I finally got how to solve this question
After we enabled the locale in the /etc/locale.gen and use locale-gen to generate it. I have to also set the locale system-wide,
create the /etc/locale.conf file
and set the default locale
localectl set-locale LANG="de_DE.UTF-8"
Then if I exit and log again, the oh-my-zsh will work fine.

Setting default make options for Qt Creator?

How can i override default make parameters , which is:
make -w
Each time i create a project , i had to modify project settings , adding -j4 to make parameters.
Can i set make -w -j4 by default ?
EDIT
The best way to do this is setting MAKEFLAGS environment variable , i'm picking the only answer as the best only to shut this thread down.
To set this for UNIX, modify the *.desktop file of Qt Creator , prefix the line entitled Exec= with env MAKEFLAGS=-j4 , but be aware that you won't be able to cease building in QtCreator immediately after setting to multithread.
To make it global and permanent go to
Tools > Options > Build & Run > Kits > (pick your toolchain)
and fill your predefined env settings: MAKEFLAGS=-j4
In the qtcreator go to the "Projects tab" and set "Make arguments" as you like:
If you want -jx parameter to be default each time you create a new or open some project, you must add enviroment variable MAKEFLAGS to your system with value -jx.
For example, at ubuntu for 8 - threding compilation this options can be realized by adding
MAKEFLAGS="-j8"
to /etc/enviroments
Result will be:
After attempting implement the fix described in the question I eventually found the following (clearly this in only a solution to linux's that use the freedesktop concept of .desktop files):
The line in "/usr/local/share/applications/Nokia-QtCreator.desktop" was:
Exec=/opt/qtcreator-2.5.2/bin/qtcreator.sh %F
I changed it to:
Exec=env MAKEFLAGS=-j16 /opt/qtcreator-2.5.2/bin/qtcreator.sh %F
And got the functionality requested in the question.
Ok, I have no idea why following the instructions in the question I didn't get there but I didn't. I hope this explanation will help someone.

Resources