Perl Inline::java module - java

I am trying to install Inline::Java module in cpan but getting the following error. Please can someone help. Thank you.
Welcome to the Inline::Java installation procedure.
A Java 2 SDK is required to install and use Inline::Java. Please
specify your Java 2 SDK installation directory using the J2SDK
option to Makefile.PL as such:
perl Makefile.PL J2SDK=/path/to/your/j2sdk/installation
You can set the JAVA_HOME environment variable to specify your
Java 2 SDK installation directory. For example, if you are using
the CPAN installer you can do:
JAVA_HOME=/path/to/your/j2sdk/installation cpan Inline::Java
Warning: No success on command[/usr/bin/perl Makefile.PL]
'YAML' not installed, will not store persistent state
PATL/Inline-Java-0.53.tar.gz
/usr/bin/perl Makefile.PL -- NOT OK
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
Could not read metadata file. Falling back to other methods to determine prerequisites
Failed during this command:
PATL/Inline-Java-0.53.tar.gz : writemakefile NO '/usr/bin/perl Makefile.PL' returned status 256
I haven't used java anytime. Please throw some light on it for proper understanding for java. Thank you in advance.

This helped me out
http://www.cyberciti.biz/faq/centos-linux-6-install-java-sdk/
And I am able to run the sample java code. Thanks.

Related

Can anyone interpret what these instructions mean? Trying to install a JVM to a mac

Please bear with me. I'm a biology student trying to perform Species Distribution Modeling of certain plant species in Australia using R Studio (specifically using a Maximum Entropy model) and I have a limited understanding of the command line.
In order to do this, I need to use the rJava package in R Studio. While the installation seems to work, when I run the command:
library(rJava)
I get this warning message:
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
So I found this tutorial online:
https://github.com/s-u/rJava/issues/86#issuecomment-261039681.
Towards the bottom of the page, the user gwarnes-mdsol gives a step-by-step guide to fixing this problem using my mac's command-line. I am supposed to install Java, uninstall any existing rJava packages, and then run a few lines of code that he wrote out. However, I can't seem to get past this step. What does he mean when he says to add the export command to the the filepath he supplied? Am I supposed to fill in portions of this code with filepaths that are specific to my computer?
# Add the following lines to /Users/<userid>/.bashrc:
# Set JAVA_HOME so rJava package can find it
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)/jre
I'm not sure where to begin with this. I've tried downloading a JDK (jdk-11.0.6_osx-x64_bin.tar.gz) and renaming it JAVA_HOME but then I don't know where to put it in my computer. I don't know where to find a .bashrc file. How can I run this code properly?
Any help is greatly appreciated!

How to execute Carrot2 Document Clustering server

I downloaded the Carrot2 Document clustering server build 3.15.0 for Mac. The read me file says:
The DCS requires a Java Runtime Environment (JRE) version 1.7.0 or later. To
run the DCS, execute the 'dcs' script and point your browser at
http://localhost:8080 for further instructions.
Mac OS Sierra doesn't make it easy, but I got 1.8.0_112 installed.
The problem is that I don't know how to execute the 'dcs' script.
There are .cmd, .sh, .war, and .jar files. I wasn't sure which of those to work with. I thought .jar looked promising, so I followed some of this thread and tried this in a terminal window:
java -jar invoker.jar
I cd-ed to the correct directory, but it just says Provide main class, but I'm not sure what or where that is.
Can anybody provide instructions or a link to how to do this?
Use the dcs.sh (on Linux/Mac) and dcs.cmd (on Windows) to start the server. The scripts will set some extra options for the JVM and then start the DCS. In case of any problems, append the -v option to see diagnostic output.

jep for using scikit model in java

I am using jep for running python script in java, I basically need to run the script that uses scikit package. But it shows me error when I try to run, which I couldn't understand.
This is the piece of code in my program,
Jep jep = new Jep();
jep.eval("import sklearn");
It shows the below error,but sklearn works perfectly well in python.
Jul 06, 2016 5:31:50 PM JepEx main
SEVERE: null
jep.JepException: jep.JepException: : /usr/local/lib/python2.7/dist-packages/sklearn/__check_build/_check_build.so: undefined symbol: _PyThreadState_Current
Contents of /usr/local/lib/python2.7/dist-packages/sklearn/check_build:
setup.py __init.pyc _check_build.so
build init.py setup.pyc
It seems that scikit-learn has not been built correctly.
If you have installed scikit-learn from source, please do not forget
to build the package before using it: run python setup.py install or
make in the source directory.
If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.
at jep.Jep.eval(Jep.java:485)
at JepEx.executeCommand(JepEx.java:26)
at JepEx.main(JepEx.java:38)
Caused by: jep.JepException: : /usr/local/lib/python2.7/dist-packages/sklearn/__check_build/_check_build.so: undefined symbol: _PyThreadState_Current
Contents of /usr/local/lib/python2.7/dist-packages/sklearn/check_build:
setup.py __init.pyc _check_build.so
build init.py setup.pyc
It seems that scikit-learn has not been built correctly.
If you have installed scikit-learn from source, please do not forget
to build the package before using it: run python setup.py install or
make in the source directory.
If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.
at /usr/local/lib/python2.7/dist-packages/sklearn/check_build/__init.raise_build_error(init.py:41)
at /usr/local/lib/python2.7/dist-packages/sklearn/check_build/__init.(init.py:46)
at /usr/local/lib/python2.7/dist-packages/sklearn/init.(init.py:56)
The _PyThreadState_Current error implies that it's using the wrong Python. You should be able to fix it by setting PATH and LD_LIBRARY_PATH to the python/bin and python/lib directories you want to use (and built Jep and sklearn against) before launching the process. That will ensure that Python, Jep, and sklearn are all using the same libraries.
If that doesn't work, it's possible that Jep or sklearn were built with different versions of Python than you're running.
We had the same problem.We believe it's a build problem and since rebuilding scikit-learn did not solved that we ended up using scikit-learn using the prebuilt Anacoda2.

jnetpcap library unable to build on ubuntu 12.04

I am trying to install JNetPcap and followed the instructions given at here. At step 12, I am unable to run the ant command and i see the error
Error: JAVA_HOME is not defined correctly.
We cannot execute /usr/lib/jvm/java-6-sun/bin/java
As I am able to run Java classes from eclipse or from command line I don't think if it's a problem with JAVA_HOME.
echo $PATH shows
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/java-6-sun/bin
Kindly let me know if am missing something here.
thanks in advance
Neither running java from the command line or running eclipse will require JAVA_HOME to be set. However, the build procedure you are trying to use ant, and ant often does require JAVA_HOME to be set appropriately. (It actually depends on the version of ant that you are using. The use of JAVA_HOME is typically in the wrapper script for ant.)
Just set it.
JAVA_HOME should probably be set to /usr/lib/jvm/java-6-sun ... based on what you gave said PATH to.
However, it is also possible that the problem is that your PATH is incorrect. Or that you have (somehow) managed to get the owner/group/permissions on your Java install incorrect, such that the java command isn't executable.
Check that running java -version displays the installed Java version.
Repeat with /usr/lib/jvm/java-6-sun/bin/java -version.

Java is not working in my PC

I had installed Java in my PC and it was working perfectly. Suddenly something went wrong and now I m not able to open swing applications and its showing the error 'Java not found'. But I can run the Eclipse IDE which also needed Java to run. So I decide to reinstall the Java, but when I tried to uninstall the Java it shows the Error 1723 - There is a problem with this Windows Installer Package. So I have installed a new JDK in another location and set the PATH. Still I am not able to run the Swing application.
Can anybody help me on this?
How are you running your swing application?
If it's from the command line like java mySwingApp and you're getting java not found then your PATH isn't set properly. Make sure that the java/bin directory is on your PATH not just the top level directory. You can test your PATH by just typing java in a console window - it should print the java help page.
If you're not running from a terminal like above, then you may need to set a JAVA_HOME environment variable which points to your java installation folder. Here's a tutorial on setting JAVA_HOME
Setting JAVA_HOME
Hope this helps,
Will
This is close to jakob's answer, about trying to get your Java install setup correctly again, just with a little more detail.
I had a similar problem on my Windows 7 box where I was trying to uninstall Java and do a clean install of a newer version. Something got messed up and I would get the 1723 error message during the uninstall and attempted reinstall. Here's information about how I was able to fix the problem, and maybe this will help you:
Look at the log files for the uninstall/reinstall. On Windows 7 they can be found at c:\users\username\AppData\Local\Temp\
The java_install.logdidn't show any extra information, but I had several MSI##### log files that contained error messages about the failed uninstall. The message was: Error 1723.There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor. Action UninstallJRE, entry: MSIUninstallJRE, library: C:\Program Files\Java\jre6\bin\regutils.dll
There was indeed no regutils.dll file, and not even the bindirectory was there. So I copied over a regutils.dll file from another computer, ran the uninstaller, and it worked. Then the new clean install of Java also worked.
So take a look at your logfiles and hopefully that will give you more detailed information about the 1723 error.
This usally happens when you delete Java files manually.
If you try to uninstall Java and it fails, it generates a log file.
Should be in C:\Users[Username]\AppData\Local\Temp
Almost at the end the missing file(s) can be found.
Try to copy that file(s) from a working installation to your computer.
Then you should be able to uninstall your Java and install a new version.

Categories

Resources