Can not install relational algebra interpreter writen in Java - java

RA is a simple relational algebra interpreter written in Java.
RA is packaged with SQLiteJDBC, so one can use RA as a standalone relational-algebra database system.
I downloaded the zip file and extracted the contents in a folder. According to the instructions the next step should be: "To run RA, just type "java -jar ra.jar" in the directory containing ra.jar. RA will then by default run on the SQLite database file sample.db (on which query examples below are based).".
I opened the Windows commander (I run Windows 10) and typed in the directory that contained ra.jar, java -jar ra.jar and pressed enter. I received an error message:
'java' is not recognized as an internal or external command, operable program or batch file.
Can you help me?

Make sure you have installed JAVA on your machine. If you have, check if path to your JAVA_HOME it is present in %PATH%.
You can see PATH variable by
echo %PATH%

Related

How do I find where Java is installed on Windows 10?

I recently installed Java (Java Runtime 1.8.121) to my machine. I need to set up JAVA_HOME and set the variable from the Java folder where it installed.
Everywhere I have looked online says the Java folder should be located in Program files (x86), however, it is nowhere to be found. Its not in program files (x86), not in program files.
I wasn't able to choose a destination when it was installed as Software center was used. It simply completed the installation.
Can someone please help me find where the Java folder is so I can set up JAVA_HOME???!
cmd:
where java
git bash (same as cmd or):
which java
powershell:
(get-command java.exe).Path
Superuser: Equivalent of cmd's "where" in powershell
Open a command prompt
type: wmic product where "Name like '%%Java%%'" get installlocation,Name
This command can take a minute to complete. But should return something like this.
Edit: The benefit of this command, is that it doesn't rely on any system environment variables. It searches for installed programs that have the word 'Java' in the name. It won't return extra files or locations.

how to automatically install Visual C++ Redistributable for Visual Studio 2015 used in a java code

For running a java code (that includes a JXInput code for a Joystick use), I only run this .bat:
jre1.8.0_66\bin\java.exe -Djava.library.path=d:\HG -jar HG11.9.jar
But, that works if I has PREVIOUSLY installed the VC redistributable.
As some people are not software specialists, they don't know how to install this vc_redist_.exe from https://www.microsoft.com/en-US/download/details.aspx?id=48145. I mention "" because it depends on the system they have (vc_redist.x64.exe or vc_redist.x86.exe).
I am sure that this problematics consisting in facilitating procedure of installation of a game and, more generally, a product has been already solved. So, what is the good practice to manually avoid to install the vc_redist?
In other words, is it possible to include this vc_redist in the .jar? Then, only running a .bat (like above) allowing to run the game.
If not, is it possible to run a single .bat or something else that:
- unzip the .zip file of my game (this file includes the game and the vc_redist)
- then automatically install the vc_redist, depending on the system (32 or 64 bits) - by what means?
Thanks a lot for your response
If you already have bat file for install best way to do this will be to include install of vc_redist in this *.bat before install. From what I know it is not posiible to include this in the *.jar. Better will be to pack all files into zip (together with this *.bat script).
To install vcredist in bat silently you will have to add these commands:
#echo OFF
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OS=32BIT || set OS=64BIT
if %OS%==32BIT runas /user:Administrator %~dp0\vcredist_x86.exe /q /norestart
if %OS%==64BIT runas /user:Administrator %~dp0\vcredist_x64.exe /q /norestart
#rest of your script
Checking if system is 32bit of 64bit is taken from here (batch file to check 64bit or 32bit OS)
%~dp0 resolves to the full path of the folder in which the batch script resides.
Edit:
As the runas might not be the best solution to problem of running this as administrator I will direct you to these posts to read about running with administrator privilages in bat
How to code a BAT file to always run as admin mode?
How can I auto-elevate my batch file, so that it requests from UAC administrator rights if required?

I want to run the libGDX-setup jar file how to do it

Whenever I type the following Command :
-jar libGDX-setup.jar in Command Prompt .It Shows the below error
1.-jar' is not recognized as an internal or external command,
operable program or batch file.
2.Whenever I type the command libGDX-setup.jar in the command prompt
Error:It displays the AlZip with the files present in it.
Questions
1.What is the location in which this jar file must be placed.
2.How to run the setup file when I double click or type the command.
Use
java -jar libGDX-setup.jar
command and make sure java is installed in your PC and path of java is defined in your system and added in Environment variable. In my PC path is
C:\Program Files\Java\jdk1.8.0_60\bin
It may be helpful, Thanks

How do I set $PATH using PHP?

My site is being hosted on a shared server so I don't have su access. I needed to run a piece of code with java but it's not available on the server. So I got a self-extracting version of java and put it on the server in my home directory. Then I gave executable permissions to java and I try running the code. I have to use relative paths when running the file because of the restrictions of the server.
Trying to run the java file ../java/bin/java -jar 'javafile.jar' gives me the following:
error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
I looked and libjli.so is located at ../java/lib/i386/jli/libjli.so. So I'm thinking that because I'm running java using a relative path it doesn't exactly know how to look for the other files. I'm hoping that if I can add absolute/path/to/java/bin to $PATH then this issue will be resolved.
So once I'm running my PHP, I can use dirname(__FILE__) to get the full path of my java bin directory. I've tried the following code:
exec('export PATH='.$bin_path.':$PATH', $output, $return);
print_r(array(getenv('PATH'), $output, $return));
Prints:
Array(
[0] => /usr/local/admin/bin:/usr/local/admin/bin/servers:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/bin:/usr/bin,
[1] => Array(),
[2] => 0
)
So nothing was added to $PATH, no output was given, and the command returned a successful exit value. Is it just the restriction of the server that is preventing me from getting this working?
Firstly, this is not going to work.
exec('export PATH='.$bin_path.':$PATH', $output, $return);
It will launch a child process with a shell, run the export command in the shell, and then the shell will exit. But the export command only changes $PATH for that shell.
I'm not sure, but I suspect that you need to use putenv.
I'm hoping that if I can add absolute/path/to/java/bin to $PATH then this issue will be resolved.
Well, it could only help if you used a simple command name for invoking the java command.
And it would be simpler to just run java using the full absolute pathname; e.g. "/absolute/path/to/java/bin/java"

Jar file not running from MSSQL stored procedure?

Hi All I'm trying to run a jar a file from MSSQL stored procedure. But I'm getting the error "'java' is not recognized as an internal or external command,"
I'm using the following command from stored procedure
EXEC master..xp_cmdshell 'java -jar C:\admin\yyyyy\xxxx.jar'
I have installed JRE and also added it in environment variables. I'm able to execute the same jar file from command prompt. Please let me know if I'm missing something
Have you tried including the full path to the java executable (ie: c:\java\jre\bin\java.exe -jar C:\admin\yyyyy\xxxx.jar)?

Categories

Resources