Command Not Found when Installing JPostal on Windows 10 - java

I'm trying to setup JPostal + LibPostal on a Windows 10 PC.
JPostal documentation states that the following command must execute without errors:
pkg-config --cflags --libs libpostal
However, when I execute the above command I get the following error:
bash: pkg-config command not found
The documentation did not state to install any other software to execute the above command. Is there something missing? I'm on Windows 10.
Update:
I re-read the documentation on libpostal which states:
libpostal has support for pkg-config, so you can use the
pkg-config to print the flags needed to link your program against it..
It seems like once I install libpostal the above command should work. Why isn't it working?
Thanks

bash: pkg-config command not found
shows that you are using WSL (Windows Subsystem for Linux) or Cygwin. In either case, you will first have to install the pkg-config package using the command below. Afterward, the setup shall work.
sudo apt install pkg-config

Related

Ubuntu Libgdx problem - No X11 DISPLAY variable was set

My problem is with X11 variable - when Im trying to launch gdx-setup.jar i get output:
Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set,
or no headful library support was found,
but this program performed an operation which requires it,
at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:166)
at java.desktop/java.awt.Window.<init>(Window.java:553)
at java.desktop/java.awt.Frame.<init>(Frame.java:428)
at java.desktop/java.awt.Frame.<init>(Frame.java:393)
at java.desktop/javax.swing.JFrame.<init>(JFrame.java:180)
at com.badlogic.gdx.setup.GdxSetupUI.<init>(GdxSetupUI.java:101)
at com.badlogic.gdx.setup.GdxSetup.main(GdxSetup.java:620)
Im running ubuntu on my local laptop (NO SSH).
System details
I've tried commands:
sudo apt-get update --fix-missing
sudo apt-get update
sudo apt-get clean
sudo apt-get autoremove
sudo dpkg reconfigure -a
sudo apt install -f
It didnt help at all...
When Im running AWT from intellij I can see GUI normally and there's no exception.
Ive followed there instructions while installing libgdx:https://tutorialforlinux.com/2022/11/14/step-by-step-libgdx-ubuntu-22-04-installation-guide/2/
echo $DISPLAY
output:0
Installed: xorg-x11
Double clicking on jar causes with no response... Ive marked jar as executable
You can specify one of many installed java versions when running from intellij. When running from the command line its just a single one.I think your default java probably -actually truly is- headless. Follow this guide here to change your default command line java. I mean the error is specifically that if fails the headless check.
Follow here to switch the default cmd line java version.
https://computingforgeeks.com/how-to-set-default-java-version-on-ubuntu-debian/
Its not unusual to have headless because thats all server side stuff needs.

I'm trying to install openjdk11 in win 11

I've tried running this command in PowerShell as an admin:
choco install -y openjdk11
and it returns this error:
I use "winget" to download packages from Powershell. Firstly, you have to search for the package, which would look like this:
winget search openjdk
This will provide many options along with the ID which you will need to install the program.
To install, use
winget install {Program ID}

I am getting the following error when I run mvn on OS X Mavericks: Cannot run program "/bin/sh": error=2, No such file or directory

I am running OS X Mavericks on a MacBook Pro.
I have maven 3.0.5 installed.
When I run mvn, I am getting the following error message.
Error while executing process. Cannot run program "/bin/sh": error-2, No such file or directory
And before you ask:
PATH="/usr/local/apache-maven-3.0.5/bin:/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin:/usr/local/bin:/bin:/usr/bin"
M2_HOME="/usr/local/apache-maven-3.0.5"
M2="/usr/local/apache-maven-3.0.5/bin"
MAVEN_OPTS="-Xms256m -Xmx768m -XX:MaxPermSize=512m"
I am also seeing the following near the beginning of the mvn output:
[WARNING] Some problems were encountered while building the effective settings
[WARNING] Failed to use environment variables for interpolation: Cannot run program "env": error=0, spawn failed #
I had the same problem: exec() failed with ANY executable. Finally remembered that I was using a private jre. That jre was a copy of the original one, just with bin/java set as executable.
I made lib/jspawnhelper executable and it worked!
If you are using eclipse , this is due to the java version. point java to your OS java instead of eclipse java. this will be solved
It seems your system is missing the "sh" shell to start interpreting the script.
I just looked up installed shells on Mac OSX and got this result:
/bin/zsh
/bin/ksh
/bin/tcsh
/bin/bash
/bin/sh
So when "/bin/sh" is missing, try "/bin/bash" for example.
Better:
Check if "/bin/sh" exist
If exist check if the user which runs the command can execute the shell
Because it can be possible that the shell binary exist but isn't executable for you. Then you have to make it executable for the user trying mvn.
Hope that helps ;)

Modifying JDK Path for Oracle SQL Developer in Ubuntu

I have Oracle SQL Developer installed at the following location:
/opt/sqldeveloper
Every time I run it using the command ./sqldeveloper, I get the following error from the GUI:
You are attempting to run with Java 1.6.0_31. Running this product is
supported with a minimum Java version of 1.7.0_51 and less than 1.8
I updated the sqldeveloper.conf file with the following paths:
/usr/java/jdk1.8.0_05
and
/usr/java/jdk1.7.0_55
And despite all that, same error again.
I know I am a bit late with the response, but I had exactly the same issue until this morning.
What I did is changed:
~/.sqldeveloper/4.0.0/product.conf
FYI:
How I figure it out:
1. Go to OracleSQLDeveloper -> Help(menu) -> Properties
2. Find 'java.home'
(For some reason it was pointing to /usr/lib/jdk1.7.0 (ver 1.7.45), even I've changed sqldeveloper.conf)
3. Since I didn't recognized that specific version, I just ran:
sudo "find / .... -name '*.conf' -exec grep 'jdk1.7.0' ..."
goodluck
Configure Path to Java
SQL-Developer needs to know how to find your Java Developer Kit:
Note: You need to specify /usr/lib/jvm/java-6-openjdk-i386 on 32-bit OS installations.
Terminal
cd $HOME
mkdir -p .sqldeveloper
cd $HOME/.sqldeveloper
echo "/usr/lib/jvm/java-6-openjdk" > jdk

java.lang.NoClassDefFoundError: Could not initialize class java.awt.Component

When I run MATLAB install script in Ubuntu, I get the following exception:
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class java.awt.Component
longer output is available here
I know that it's a Java problem and could potentially be fixed by changing the classpath or something like that but I don't exactly know how.
Any Ideas?
For me this error was fixed when I installed the JRE on my system:
apt-get install default-jre
on Ubuntu 12.04, instead of having MATLAB use its own.
I've been battling this problem for the whole evening as well but I stumbled onto a solution that works for me at least.
After trying to install using the silent installer I got a different error with a bit more information. It turned out that a library was missing (libXtst.so.6). I was able to install that on my Ubuntu system with:
apt-get install libxtst6
After that I tried running the GUI installer (over X forwarding) and it looks like it's going to work now.
For MATLAB R2012a Student Edition, in Ubuntu 14.04, I had to install these prerequisites first:
sudo apt-get install default-jre libxtst6:i386 libXext6:i386 libxi6:i386 libncurses5:i386 libxt6:i386 libxpm4:i386 libxmu6:i386 libxp6:i386
Next I installed/activated per MATLAB's instructions (sudo ./install). I answered "yes" when the installer asked to add a symbolic link in /usr/local/bin/
Finally, when launching MATLAB, I have to specify that it run in 32-bit mode:
matlab -glnx86
I assembled those steps from this answer: https://askubuntu.com/questions/363878/how-to-install-32-bit-matlab-in-ubuntu-64-bit
and the Ubuntu MATLAB guide:
https://help.ubuntu.com/community/MATLAB
Optional
I didn't want to type the -glnx86 option each time I launch MATLAB, so I replaced the matlab symbolic link in /usr/local/bin/ with a script that automatically specifies the -glnx86 option:
ls -l /usr/local/bin/matlab #note the destination of the symbolic link
sudo mv /usr/local/bin/matlab /usr/local/bin/matlab.bak
#ensure the first path below matches your symbolic link's destination
echo '/usr/local/MATLAB/R2012a_Student/bin/matlab -glnx86 "$#"' | sudo tee /usr/local/bin/matlab
sudo chmod +x /usr/local/bin/matlab
With that, I can type 'matlab' and it launches properly. (The "$#" in the script forwards all input arguments to matlab.) There's probably a more elegant way to accomplish this, but it worked.
I also encountered a "/lib/libc.so.6: not found" error on matlab startup, which I fixed by following this answer.
Installing gnome (sudo apt-get install gnome) fixed this problem for me. I'm sure this was total overkill, but the required libraries are now available.

Categories