Issue Running MatlabControl - java

I have successfully compiled the "Hello World" example found on this link: http://code.google.com/p/matlabcontrol/wiki/Walkthrough.
However, when I try to run it, I get the following exception:
Exception in thread "main" matlabcontrol.MatlabConnectionException:
Could not launch MATLAB. Command: [matlab, -desktop, -r, javaaddpath '/usr/local/MATLAB/R2011a/java/jar/matlabcontrol-4.0.0.jar'; matlabcontrol.MatlabClassLoaderHelper.configureClassLoading(); javarmpath '/usr/local/MATLAB/R2011a/java/jar/matlabcontrol-4.0.0.jar'; matlabcontrol.MatlabConnector.connectFromMatlab('PROXY_RECEIVER_6eb278d0-1401-4b9c-b9e4-80512708f9b7', 2100);].
I have Matlab2011a installed in Ubuntu 11.10.
Could anyone point out where the problem could possibly be?

If you check the compatibility between OS and MATLAB version?
https://code.google.com/p/matlabcontrol/wiki/Compatibility
I suggest that you should update matlabcontrol-4.0.0.jar to latest version matlabcontrol-4.1.0.jar which can be downloaded from website.
Remember to open MATLAB before running the code and check if you have included all related jar files (jmi.jar...etc)to the java build path.

That exception that you posted suggests that you need to add Matlab to your system path. Check online guides on how to do that on Ubuntu.

Related

Apache nifi doesn't start

I've tried several times to run an Apache Nifi server, but it won't work. I'm using windows 8 and installed java version 8.
I get this error message:
'nifi-env.bat' is not recognized as an internal or external command, operable program or batch file.The JAVA_HOME environment variable is not defined correctly.Instead the PATH will be used to find the java executable.
Error Screenshot:
I've tried the solution to the following similar problem, but this did not help:
Nifi commands on windows
I've also tried what is explained in this video, but this did not work either:
How to Install Apache NiFi and run Simple Process
What should I do in order to run the nifi?
There seems to be a Java installation error, which is affecting the nifi-env.bat file. Problem will be solved if you create a virtual environment with java. The following link explains how to create a Java Virtual environment. This will also solve the problem with 'nifi-env.bat' is not recognized as an internal or external command as in that case nifi would only be able to be run within the virtual environment.
Try to troubleshoot the problem by reinstalling java, if the above doesn't work out.
I have pulling my hair off for this, but I discovered the directory which holds nifi, must have not spaces.
My folder's name was "apache nifi" and there I unzipped the download from apache nifi's website, but after one hour I realized the name could be the problem, and actually it was. I just changed folder's name from "apache nifi" to just "nifi" and voilá, it just runs.
Check if JAVA_HOME path is set properly.

Jar file error on the web server

I have a .jar file that works perfectly on my mac, but I need to run it on the web server... So when I use command line to make this file work it gives me this error:
[root#mysite.com dist]$ java -jar PDFparser.jar ffive.pdf
Exception in thread "main" java.lang.NoSuchMethodError: method java.lang.String.getBytes with signature (Ljava.nio.charset.Charset;)[B was not found.
at org.apache.commons.io.IOUtils.write(IOUtils.java:1527)
at org.apache.commons.io.FileUtils.writeStringToFile(FileUtils.java:1929)
at org.apache.commons.io.FileUtils.writeStringToFile(FileUtils.java:1962)
at pdfparser.PDFparser.main(PDFparser.java:171)
I am not the one who created that .jar app but it works just the way I need on my mac... but it need it for the site, so I need it to be working on the web server... Does anyone know what does this error mean and what should I do? I don't know Java language so it would be awesome if you explain to me what should I do like I'm very stupid person...step by step... :)
String.getBytes(Charset c) has only been available since Java 1.6. Most likely, the Java version on your Mac is 1.6+, but your target server is less than 1.6.
You will need to update to at least Java 1.6 on your web server for this method to be available.
Source
This
java.lang.NoSuchMethodError: method java.lang.String.getBytes with signature (Ljava.nio.charset.Charset;)[B was not found.
means that a class in your jar file couldn't find a corresponding method in the Java installation. I suspect your jar file was created with a java version greater/newer than that installed on your web server.
On your working server, type
$ java -version
and do the same on your web server, and compare the version numbers.
There is no issue with your mac or the webserver. The jar was created with a lower version of Java (1.5 or below) while String.getBytes() is only available with java 1.6+.
There is a version mismatch.

re install Jdk1.6 in windows 7?

I have installed jdk1.6 in E: drive of windows 7.I developed a simple .java file and try to run it through the command prompt using "javac" but it says javac is not recognized as internal or external command.So i checked just by running java it runs fine .so I thought that i should uninstall that jdk and reinstallit but i am getting windows 1723 error
opened a control panel and tried to remove jdk from there but got this "Error 1723.There is 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"
to be able to run javac from the command line, you need to add the path to javac to the PATH environment variable.
It looks like the 1723 error describes a problem with the installer itself. I would follow the advice from Microsoft Answers and Oracle to fix the installation. A correct install of Java should add the necessary entry on the Windows PATH. Make sure you open a new DOS (or Command) window after installation otherwise the amended PATH might not be picked up.
Probably,you are facing the below issue: https://forums.oracle.com/forums/thread.jspa?threadID=2213081. You can use ccleaner to uninstall all the instance of jdk/jre.The issue is happening due to interrupting in installing/uninstalling.If ccleaer is not solving your problem registry cleaning is the only option as shown on the above link.
You probably have java.exe on your \windows\system32 folder... And since this folder is on the path env var it got confused. Try to delete this/these java*.exe files from \windows\system32 folder.
If you encountered a problem with Java error 1723 when you try to reinstall Java.
It may occur when you delete the Java directory by error
_ Go to your Microsoft Event Viewer you'll see one error line like this
Event viewer
_ Then copy an Java bin directory from an other server to have back the lost dlls in the directory mentioned in the events viewer
_ finally reinstall Java
Hope it helps
I have used Microsoft utility(fix-problems-that-block-programs-from-being-installed-or-removed) to resolve this error it saved me doing manual work and it is safe also :
https://support.microsoft.com/en-us/help/17588/fix-problems-that-block-programs-from-being-installed-or-removed

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.

Getting error "bash: appletviewer: command not found".

I'm trying to learn Java and I'm having problems with the appletviewer command. I am using openSUSE 11 and am able to compile and run normal java programs but when I issue the appletviewer command I'm getting the following error "bash: appletviewer: command not found".
I have set the PATH variable in the .bashrc file. so the problem is not that of the path. This can also be verified from the fact that javac and java commands are working normally. I have googled and tried many said resolution but none is working. I have even tried moving the files to the bin folder and running the command from there.
So what may the cause of this? Isn't appletviewer designed to work in linux? And FYI I have replaced the OpenSDK and IcedTea versions with the jdk1.6.0_14 version from the sun site. Please help.
Thanks
Chris
As a test, do the following:
$which java
$which appletviewer
Check to see if the paths are different. If the second command gives no output, appletviewer may not even be installed (or can't be located by your system).
You need to install java-1_6_0-sun-devel-1.6.0.u14-0.2.1
$ sudo zypper install java-1_6_0-sun-devel
You will find it in the openSUSE-11.1-Non-Oss repository.

Categories

Resources