JRuby installation gives Java path error - jruby

I have downloaded jruby-bin-ion 1.7.8 package and unzipped it in the C drive.
I have set the PATH and JRUBY_HOME environment variables. Java is installed and path and environment variables are set for Java. Java programs run well.
When I run jruby -version command from the command prompt, it gives me the following error:
Cannot locate Java installation, specified by JAVA_HOME:
C:\Program Files (x86)\Java\jdk1.7.0_25;

Very late to the party here, but I had tried
set JAVA_HOME="C:\Program Files\Java\jdk1.8.0_131"
and got the message
Cannot locate Java installation, specified by JAVA_HOME:
"C:\Program Files\Java\jdk1.8.0_131"
The answer about semi-colons brought into focus the quotes might be causing the problem. And they were.
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131
fixed my problem.
So, no quotes. No semi-colons.

Set the environment variable correctly
JAVA_HOME = "C:\Program Files (x86)\Java\jdk1.7.0_25"
No semi-colon if its only one value.

Related

I am working with JDBC, and I have used mysql-connector 8 to run my java program from command line

When I am compiling the Java code, I have written the command line shows the following:
C:\HTML>javac Jdbc.java
Jdbc.java:5: error: package com.mysql does not exist
Class.forName(com.mysql.jdbc.Driver);
^
1 error
I have installed XAMPP and started the Apache, MySQL and Tomcat and they are working. I have installed MySQL Connector which is platform independent and latest. I have copied the JAR executable file to the JDK folder. I have added the jar executable file path in the edit system environment variables,
''' Class.forName(com.mysql.jdbc.Driver);'''
If you reference classes from a library, you should add that library to the classpath (i.e. javac -cp .;path\to\your\mysql-connector.jar Jdbc.java). However, that would immediately result in a different error, because that code should be Class.forName("com.mysql.jdbc.Driver") (passing a String).
Some further remarks:
I have copied the JAR executable file to the JDK folder.
You should never manually copy files to the JDK folder (in older versions there was the ext mechanism, but this no longer exists in recent Java versions). In addition, MySQL Connector/J is a library, not an executable jar.
I have added the jar executable file path in the edit system environment variables
Java JARs do not belong on the PATH. In theory you can add them to CLASSPATH environment variable, but that is generally considered a bad idea: most ways of executing Java do not actually use it, and if it does get used, it can result in unexpected behaviour because of conflicting or unexpected libraries on the classpath, etc.

Octave can't find JRE while I have installed JRE

I have installed JRE successfully:
However, Octave keeps showing that it can't find JRE.
Make sure you installed right architecture(x86 or x64) of jre, it fixed the issue for me.
Following https://octave.1599824.n4.nabble.com/Octave-4-installer-doesn-t-detect-JRE-at-install-time-td4670684.html and: https://superuser.com/questions/1382158/on-windows-why-java-version-return-error-opening-registry-key-software-javas
run regedit.exe as Admin
change CurrentVersion in HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\ to 12.0.2
create: HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\12.0.2
set JavaHome in HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\12.0.2\ to: C:\Program Files\Java\jdk-12.0.2
open cmd and type: java -version
in case of error type: where java
cmd will return folder or few; in explorer go to the one ending with \javapath for example C:\Program Files (x86)\Common Files\Oracle\Java\javapath
there should be files: java.exe javaw.exe and javaws.exe
if so delete them, reopen cmd and type java -version
Now it should display correct version without errors
In Octave type javachk jvm
if ans is empty java should be working now
From the screenshot you presented, you have the JDK (development kit) installed, not the JRE (runtime environment). The required commands you need are there, but the operating system does not recognize this automatically. For that, you must include the 'java/bin' directory from the JDK in the PATH environment variable for your system. Next time you run Octave, it will locate and recognize the Java environment.

TCL_LIB_SPEC missing in modules install

I'm trying to install modules from SourceForge and I'm getting an error that a variable named TCL_LIB_SPEC is not set. What is this supposed to be set to?
The answer here is to install the TCL development package
% yum install tcl-devel
This gives you a tclConfig.sh file at /usr/lib64/tcl8.5
So
% cd /usr/lib64/tcl8.5
% . ./tclConfig.sh
Then configure works.
It's supposed to be set to the instructions to use with your compiler for linking against the Tcl C library, and it should (conventionally) be generated by running the relevant configure script inside a Tcl source distribution. Or a distribution of Tcl (e.g., on Linux perhaps called tcl-dev) may have alternate correct values already set up.

'ALGOLIA_API_KEY' not recognized as an internal or external command

I am trying to run algolia for the first time but it seems that there is something wrong with my environment. I followed the detailed explanation here https://community.algolia.com/jekyll-algolia/getting-started.html.
I installed and configured everything that is needed from the previous steps but when I run the command
ALGOLIA_API_KEY=xxxxxxxxxxxxxx bundle exec jekyll algolia
I get an error:
'ALGOLIA_API_KEY' is not recognized as an internal or external command,
operable program or batch file.
I have been rereading the documentation for both jekyll and angolia but couldn't find anything that could be helpful.
Since you're running on Windows, you cannot set an environment variable for your command like you can do on UNIX.
As advised in this question, Setting and using variable within same command line in Windows cmd.exe, I believe you could use
set ALGOLIA_API_KEY=xxxxxxxxxxxxxx && bundle exec jekyll algolia

FlashDevelop Configuration Issue - demands Java 1.6

I've been using Flashdevelop (version 4.4) for some time now with zero problems. I recently reinstalled Windows 7 however, and after installing Flashdevelop it is demanding Java 1.6 and won't compile without it. Let me be more specific, here is the error I get when I try to compile a simple HelloWorld-type test:
"Running process: C:\Program Files (x86)\FlashDevelop\Tools\fdbuild\fdbuild.exe "C:\Users\marc\Documents\DeleteMe\DeleteMe\DeleteMe.as3proj" -ipc 01be003c-6cb5-4d0b-9c35-c59dd2ea7a19 -version "4.6.0; 3.3" -compiler "C:\Program Files (x86)\FlashDevelop\Tools\flexsdk" -library "C:\Program Files (x86)\FlashDevelop\Library" -cp "C:\Program Files (x86)\Java\jdk1.6.0_34\bin" -cp "C:\Program Files (x86)\Java\jdk1.6.0_34"
Building DeleteMe
mxmlc -load-config+=obj\DeleteMeConfig.xml -debug=true -incremental=true -swf-version=16 -o obj\DeleteMe634829909556672047
Starting java as: C:\Program Files (x86)\Java\jdk1.6.0_34\bin\java.exe;\bin\java.exe
Unable to start java.exe: The system cannot find the file specified
Could not compile because the fcsh process could not be started.
Build halted with errors (fcsh).
INITIALIZING: Failed, unable to run compiler
Done(1)"
The GlobalClasspath setting for the Java 1.6 JDK is set to: C:\Program Files (x86)\Java\jdk1.6.0_34\bin
I have also set my JAVA_HOME environment variable to the same location as well. Might I be neglecting to set another environment variable?
JAVA_HOME should be
C:\Program Files (x86)\Java\jdk1.6.0_34
and not
C:\Program Files (x86)\Java\jdk1.6.0_34\bin
FlashDevelop currently doesn't support that your JAVA_HOME environment var contains several paths (C:\Program Files (x86)\Java\jdk1.6.0_34\bin\java.exe, \bin\java.exe).
Modify it to only indicate the first path (C:\Program Files (x86)\Java\jdk1.6.0_34\bin\java.exe).
As someone who was dealing with this, I just found an answer that doesn't involve mucking with the PATH variables.
Go into your Flex SDK, /bin directory, look for the JVM config file conveniently named jvm.config
Inside, there is a param 'java.home' which, if left empty, will cause it to search for it's own value. Enter in the main path to the JRE - in my case,
java.home=C:\Program Files\Java\jre1.6.0_07\
I found mine by going to "Control Panel > Java > Java tab > View... button" to see all the installed versions and their paths
I prefer this method because I feel like you shouldn't have to modify settings on your whole system to get 1 program to work, if you have the option instead to just modify that program's settings.
jvm.config in C:\Program Files (x86)\FlashDevelop\Tools\flexsdk\bin\jvm.config is much more better than path variable.
Please avoid Path variable.
In jvm.config just set jre URL directory
java.home=C:\Program Files\Java\jre1.6.0_07
May be you update the Java, last version of Java ask you to delete older version. Then go into the file
C:\Program Files (x86)\FlashDevelop\Tools\flexsdk\bin\jvm.config
and replace
java.home=C:\Program Files\Java\jre1.6.0_07\
by the folder were is your new version
java.home=C:\Program Files (x86)\Java\jre1.8.0_25\