I'm currently working on a ZigBee project and I'm programming on an Mac with Mountain Lion (10.8) and using Eclipse IDE. To use my Zigbee Module via USB for Serial communication, I need this rxtxSerial.dll. I only have a Windows compatible version right now.
Is somebody able to provide the necessary link to me?
Thank you!
Edit2
With all the latest updates as of 2012-11-15 (OSX 10.8.2) i needed to install glibtool via homebrew (http://mxcl.github.com/homebrew/) before I got the procedure below to work.
With homebrew installed and configured just do
brew install libtool
from a terminal.
Then proceed as described below.
/Edit2
Edit
So, I managed to compile it for my self on OS X Mountain Lion (10.8.2) and XCode (free from App Store).
Download rxtx-2.2pre2.zip and extract. Edit the "configure" file in the extracted directory and change the line that reads:
JAVAINCLUDEDIR=$JPATH/../../../Headers
to
JAVAINCLUDEDIR=/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers
Then configure by doing
./configure
using a terminal in your working directory.
Now you will have a file named "Makefile" in your working directory, you need to edit the line in this file that reads:
LIBTOOLC = $(GLIBTOOL) --mode=compile $(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(VERBOSE_IOEXCEPTIONS) -c
to
LIBTOOLC = $(GLIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(VERBOSE_IOEXCEPTIONS) -c
And then run
make
You will now have RXTXcomm.jar in your working directory and librxtxSerial.jnilib in workingdirectory/i386-apple-darwin12.2.0
These are the files you need.
To work with them you may need to do
sudo mkdir /var/lock
sudo chmod 777 /var/lock
This approach worked for me.
PS. If you trust me you can get these files from here and here.
PPS. You may get:
WARNING: RXTX Version mismatch Jar version = RXTX-2.2-20081207
Cloudhopper Build rxtx.cloudhopper.net native lib Version =
RXTX-2.2pre2
But it should still work.
/Edit
I am also trying to use rxtx on ML and while I have not have any success yet I did find this link.
Java 6 and librxtxSerial.jnilib on Intel Mac OS X
And even though it says nothing about ML, one of the comments states that it works with Lion if you tweak it a little bit.
I'll report back if I get it to work here.
Related
I have a Spring-boot project, where I am using the ffmpeg library, I am executing the ffmpeg commands through a ProcessBuilder(in the terminal/cmd) and everything works fine, because I have already installed the ffmpeg on my macOS. When I try to generate a jar and run it on an another machine, where ffmpeg is not installed, it is executed, everything works fine, except the ffmpeg comamnds. Is there any change to import the library to my maven project or somehow to use it?
Is it a good idea to add an external jar of the library?
Thank you in advance!
Is the server you're deploying to Mac (same as your desktop) or Windows/Linux? The reason I ask is because ffmpeg is a binary app and has to be compiled to the specific platform.
You could include ffmpeg in maven, but before it runs it will need to be compiled. I found one maven repository here, though I do not know how well this will work: https://mvnrepository.com/artifact/com.tagtraum/ffmpeg/4.0.0. You could also try compiling from source (particularly if there's some non-standard encoding/decoding you're trying to do), which is a much more involved installation.
What I would do is install ffmpeg through a separate installation package, ideally through the OS's package management system; for linux this would be something like:
(Ubuntu)
sudo apt-get install ffmpeg
(CentOS)
sudo yum install epel-release
sudo yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm
sudo yum install ffmpeg ffmpeg-devel
More info on installation here:
https://www.ostechnix.com/install-ffmpeg-linux/
Sometimes these packages may be not be the latest or missing something you're trying to do, in which case you may need to compile from source.
Edit: You say you're using Windows. I'm not as familiar with deploying to Windows, but there are ffmpeg Windows packages available on this site (linked from the main ffmpeg page): https://ffmpeg.zeranoe.com/builds/ . I recommend installing separately rather than trying to package with your Java app. This page can help: https://windowsloop.com/install-ffmpeg-windows-10/
I’m not sure if Maven have a plug in for that, but I’d add a shell script to install ffmpeg, let’s call it resources/scripts/myscript.sh, in the script first validate it’s not installed already, then use wget to download what you need , install it , and continue with you app.
You can call this script from your app as the first thing to do
I've read a lot of troubleshooting for similar occurrences of this error, but what is causing it for this particular .jar?
https://download.cnet.com/android/nabin-bhandari/3260-20_4-10982661-1.html
It works on Windows, but when attempting to run the file on a raspbian (linux) system running java version 1.8.0_65 with the command java -jar Local\ Area\ Messenger\ Desktop.jar it throws the error about not being able to find or load the main class.
The MANIFEST.MF defines Main-Class: com.nabinbhandari.lam.Main and there doesn't appear to be any issues with case sensitivity.
What am I missing? Do I need to install something more than Java Runtime Environment?
Edit: In case it is not clear, I am not the developer of this file. I am simply a user trying to run the file. This question has nothing to do with Eclipse and I don't understand why people are linking to that other question. I am not running Eclipse. Please stop linking to that. Please examination the .jar file I have provided.
Edit 2: I have followed the instructions and in this answer:
https://stackoverflow.com/a/1238173/2407742
It gives the error no main manifest attribute, in test.jar
Is there something missing from my java runtime environment? It seems like nothing works.
The Local Area Network Messenger application was developed using JavaFX, which is not included in the Oracle Java build for Rasperry Pi. I had to reinstall Java and then openjfx by doing the following:
sudo apt-get purge openjdk-8-jre-headless
sudo apt-get install openjdk-8-jre-headless
sudo apt-get install openjdk-8-jre
sudo apt-get install openjfx
It runs fine now.
The solution to this was the following:
Close Eclipse/STS
Use a file explorer on your operating system to navigate to your workspace (In my case, I'm on Windows so I used Windows Explorer)
Delete the .metadata directory (or to be safe, copy the directory somewhere else to be safe, then delete it)
Restart Eclipse/STS
Is there a more improved answer than this? I don't want to look like I'm trying to boost my own reputation points, so if someone can provide a better answer then please do so.
I have several .jar files that run successfully when opened with Mac's built in 'Jar Launcher' (Version 15.0.1) but when ran from terminal they error out.
Looking online the error messages might be down to the incorrect version of Java being linked to the terminal version, so I'd like to check if the options set for 'Jar Launcher' and the Java used within terminal are the same.
Does there exist any way to do this?
This question is two years old, but as there is no answer to it, I thought I'd put my two cents here since I've had issues myself, and have made some observations.
It seems that the Jar Launcher doesn't necessarily use the same JVM version as the one shown by the command /usr/libexec/java_home: If there is a JRE /Library/Internet Plug-Ins/JavaAppletPlugin.plugin, then the Jar Launcher will use it and ignore anything in /Library/Java/JavaVirtualMachines.
I've solve my problem of version mismatch between the Jar Launcher and the terminal by removing the JRE:
Go to /Library/Internet Plug-Ins.
Remove the JavaAppletPlugin.plugin directory by executing the rm command as a root user or by using the sudo tool.
Go to /Library/PreferencePanes.
Remove JavaControlPanel.prefpane by executing the rm command as a root user or by using the sudo tool.
Source: https://docs.oracle.com/javase/9/install/installation-jdk-and-jre-macos.htm
I have built a Java app that uses SQLite (sqlite-jdbc-3.8.7.jar) and have rolled everything into a jar file. Running the jar file on windows works as expected however, trying to run it on Ubuntu Server 14.04 has turned into quite a task! I put together a brand new virtual machine in VirtualBox for testing. I installed Java (sudo apt-get install default-jre) and have tried installing SQLite both from the repositories and by downloading the tar and compiling. SQLite installs just fine both ways as I can access it from terminal. I created a new sub-directory within my home directory and copied over my app jar file. From terminal, I then run the command: sudo java -jar .jar and I receive a java.lang.unsatisfiedlinkerror. See the attached image, what else must be done to get this working on Ubuntu? Any help would be appreciated!
I have similar issue and revert to sqlite-jdbc-3.7.2 worked for me (Ubuntu 14.04 32bits)
Sqlite writes a native lib to a tmpdir and attempts to use it. If the tmp dir is on a filesystem mounted noexec, this will fail and may display an error like what you're seeing.
One way to avoid this is to set the java tmpdir as other answers have pointed out. Another is to remove noexec from your tmp fs.
To check:
$ mount | grep /tmp
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noexec,noatime,size=6291456k)
To change this, edit /etc/fstab, remove noexec from the /tmp line, then reboot or remount /tmp;
$ mount -o remount /tmp
(Note that noexec is considered a security feature, in that it prevents rogue apps from doing exactly what SQLite is trying to do here)
Well, I had similar issues and I had to revert to sqlite-jdbc-3.7.2.jar package because the driver in newer package for some reason didn't work under 64-bit linux on my (dreamhost so called vps) server. Newer package had no issues in Windows 8.1 x64. I also had to move tmp dir to home (System.setProperty("java.io.tmpdir", "/home/username/");).
Add this to your code and see if there are issues with your tmpdir...
final File tmp = new File(System.getProperty("java.io.tmpdir"));
if (!tmp.exists() || !tmp.isDirectory() || !tmp.canRead() || !tmp.canWrite()){
System.err.println("#PFTcreateDB - Issue with java.io.tmpdir");
}
This could indicate missing tmp or incorrect privileges.
I have installed ghostscript of 64 bit on my 64 bit linux machine. I am using ghost4j-0.5.0.jar to convert pdf files to tiff files. I have written a java program which will convert pdf files to tiff files. This is working perfectly fine on Windows but when i thought of moving this to linux machine i am getting the below error.
"Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'gs': libgs.so: cannot open shared object file: No such file or directory"
I checked lib folder and could not find libgs.so file in the lib folder. I am not sure where to get that file.
Can anyone please help me on this ?
I feel a little guilty posting this here since it is probably better served on ServerFault or one of the Linux boards and the question is over 6 months old but I had been banging my head against the wall all day and finally have found a solution to this problem and I figured someone else might benefit from this down the road.
Systems: Windows 7 and CentOS 6.5
Using: Ghostscript 9.14
A little backstory:
Like the OP I had been running a ghostscript program on Windows to convert PDFs to a series of images. This worked fine until I needed to switch over to Linux and run the program and about 5% of the PDFs I needed to convert came up with error cannot decode code stream. I realized that I was using a newer version of ghostscript on Windows. (9.14 on Windows compared to 8.70 on CentOS due to installing through yum).
I removed the old version with yum remove ghostscript. Next, I found the easiest way to install the newest version of Ghostscript is download from here and compile. Since I removed the previous version of ghostscript with yum I had to update the link in usr/bin to point to usr/local/bin/gs with ln -s /usr/local/bin/gs /usr/bin/gs. With everything in place, so I thought, I attempted to run my program and then bam, error!
Solving the problem:
So now I was getting the error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'gs': libgs.so: cannot open shared object file: No such file or directory
I came across a post here that said to get the necessary libgs.so I needed to go back and rebuild the source as a shared library with the command make so. I did so and then I took the libgs.so.9.14 file under sobin directory in the ghostscript folder and copied it to /usr/lib. Under that directory I made a symbolic link to libgs.so using the command ln -s /usr/lib/libgs.so.9.14 /usr/lib/libgs.so.
Once that was done I needed to update my ld_library_path but found when I did so the change wasn't global so I found a Unix & Linux post on how to set the global lib path. Basically to do so you need to go to add a .conf file in /etc/ld.so.conf.d/ with the path to the file. I did so using vi /etc/ld.so.conf.d/libgs.conf and added /usr/lib/libgs.so to the file. Lastly I ran ldconfig so save the changes.
TLDR:
Download the latest version of Ghostscript from source: wget http://downloads.ghostscript.com/public/ghostscript-9.14.tar.gz
Unpack the tar: tar -xzf ghostscript-9.14.tar.gz
cd ghostscript-9.14
./configure
make <-- You might be able to skip and go to make so, I did it in this order so I will leave it like this.
make install
make so
If you removed a previous version with yum ln -s /usr/local/bin/gs /usr/bin/gs
cp ghostscript-9.14/sobin/libgs.so.9.14 /usr/lib
ln -s /usr/lib/libgs.so.9.14 /usr/lib/libgs.so
vi /etc/ld.so.conf.d/libgs.conf
In the new libgs.conf file: /usr/lib/libgs.so and save with esc, :, wq.
ldconfig and done.
Run your conversion program.
Hopefully this helped and wasn't too confusing. I'm not a linux expert (yet) so I may be doing a little more work than necessary with the above commands but I wanted to be thorough.
I just had this issue on a linux VM. I was able to solve it by installing ghostscript on the system. I just used the command:
sudo yum install ghostscript
Hope that helps!
make soinstall will create required libs along with executables as mentioned in https://www.ghostscript.com/doc/current/Install.htm#Shared_object