I was trying to set up a MineOS server on a Raspberry Pi when I ran into an issue where I couldn't update the java version to Java 16. The Raspberry Pi is running the ARM64 architecture and I got my JDK from https://adoptopenjdk.net/releases.html?variant=openjdk16&jvmVariant=hotspot. Here is the specific JDK I downloaded onto my Raspberry Pi: https://github.com/AdoptOpenJDK/openjdk16-binaries/releases/download/jdk-16.0.1%2B9/OpenJDK16U-jdk_aarch64_linux_hotspot_16.0.1_9.tar.gz. To install it and add it to my $PATH, I did:
tar -xf OpenJDK16U-jdk_aarch64_linux_hotspot_16.0.1_9.tar.gz -C /opt/
ln -s /opt/jdk-16.0.1+9/bin/java /usr/bin/java
When running java --version, I get /usr/bin/java: No file or directory. Does anyone know why this is? Before I figured out that Raspberry Pi supports ARM64, I did this on ARM32 and it worked fine, but I needed to be able to allocate more memory to a server, so I had to update to ARM64. If you need more information, I can provide it if necessary.
I did this on ARM32 and it worked fine, but I needed to be able to allocate more memory to a server, so I had to update to ARM64
I assume you mean you are using different Pi now?
On a Pi3, I can do
wget https://github.com/AdoptOpenJDK/openjdk16-binaries/releases/download/jdk-16.0.1%2B9/OpenJDK16U-jdk_aarch64_linux_hotspot_16.0.1_9.tar.gz
sudo tar -xzvf -C /opt OpenJDK16U-jdk_aarch64_linux_hotspot_16.0.1_9.tar.gz
/opt/jdk-16.0.1+9/bin/java --version
Note: tar -xz is for TAR.GZ files, and you only wrote -x in the question...
And that gives me an error about the non-compatible binary, as expected since my Pi needs ARMv7.
From there, I would update the PATH without a symlink, like how is done in Install Java 16 on Raspberry Pi 4
So, that being said, if the file does indeed exist, then there is some other permissions issue you're having
I want the jdk to be stored in /opt/ and easy to remove all of the files related to it.
I see no real need for /opt. If you can use apt/pkg to install, then you can also use it to remove/purge files for it
Related
I have a java program in which a use the GLPK Solver. The error that i receive when i run it on eclipse is the following:
The dynamic link library for GLPK for Java could not beloaded.
Consider using
java -Djava.library.path=
The current value of system property java.library.path is:
/Users/maria/Documents/solver_library/GLPK/w64
I had the same problem on my old windows computer and i solved it doing the following:
1. Adding in the Java Build Path->Libraries the glpk-java.jar file
2.Adding as the Native library location of the above jar the corresponding path (C:\ProgramFiles\solver_library\GLPK\w64
3. adding in the PATH environment variable the above path.
I am doing exactly the same things on my new MAC OS X computer but still receiving the above error. I did with exactly the same way the steps 1 and 2 above and also I modified through the terminal the PATH system variable. This now is:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/maria/Documents/solver_library/GLPK/w64
Could you please tell me if you have any idea of how to solve this? I am a new Mac user so i don't know many things.
Thanks in advance!
Here's what I did to make it work on OS X.
Install glpk.
I used for this homebrew
$ brew install glpk
$ brew install swig // this package we well need for glpk for java
Install glpk for java http://sourceforge.net/projects/glpk-java/files/glpk-java/
Unzip the archive with:
$tar -xzf glpk-java-1.0.37.tar.gz
$cd glpk-java-1.0.37
Configure with:
$./configure \
CPPFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers \
SWIGFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers
Make and install with:
$make
$make check
$make install
Now in swig dir you should have 3 jars:
glpk-java.jar, glpk-java-sources.jar, glpk-java-javadoc.jar and the .lib folder (hidden).
For compiling you need to put glpk-java.jar in your classpath and specify javac option -Djava.library.path=/YOUR_PATH/libglpk-java-1.0.37/swig/.libs
I am trying to get JInput working on a raspeberryPi. I know it is not ideal to use JInput without an ide, but the Raspberry Pi is too slow to work with most of them. I have managed to sucessfully compile and run my program from the command line on windows. However, on the pi i am having trouble. The pi is running raspbian, java version 1.7.0_40 with hotspot client vm build 24.0-b56. I have set up the file structure as so:
lib/dist
-jinput-test.jar
-jinput.jar
-Controller
--.dll, .so files
--LinuxEnvironmentPlugin.java
bin
src
I am using the command
java -Djava.library.path=lib/dist/Controller -Djinput.plugins=net.java.games.input.LinuxEnvironmentPlugin -cp bin:lib/dist/jinput.jar:lib/dist/Controller Main
to try and run.
However, i get
"INFO: Failed to load library:" /libjinput-linux64.so: /libjinput-linux64.so: wrong ELF class: ELFCLASSS64"
This is where I am confused. Why is it trying to use the 64 bit file. The rasperry Pi has a ARM version 6 processor, which only works with 32 bit. So why is it looking for the 64 bit file in the first place? I have also tried running with the -d32 option but that doesn't help.
You need a native shared library (JNI) built for the Pi (ARM). Fortunately, there are pre-built raspbian packages for JInput that include the required native library:
sudo apt-get install libjinput-java libjinput-java-doc libjinput-jni
You should also add uinput to the end of /etc/modules so the controller gets detected. If you want a nice GUI to test the controller try also installing:
sudo apt-get install jstest-gtk
you can instal Jinput by
sudo apt-get install libjinput-java libjinput-java-doc libjinput-jni
then find these file on your raspberry pi after installation
jinput-20100502.jar
jinput.jar
jinput-test.jar
libjinput-linux.so
libjinput.so
make a new directory called (let's say) lib in your working directory (a you can name it as you wish)
copy all the files above to the directory lib you just made.
then compile the java file by this way :
sudo javac -cp "/usr/share/java/jinput.jar" Example.java
then run it by this way :
sudo java -Djava.library.path=./lib -cp ./lib/*:. Example
if you make the Example.java from netbeans, remove the package info line at the top. it should work.
• Implemented a workaround.
• Wanted to implement joystick jogging on my Raspberry Pi, Processing3 GUI on a Grbl CNC machine, but hit the JInput <==> ARM incompatibility. Believe Quark is right in asserting that no ARM compatible JInput exists. This is in contradiction to the StackOverFlow thread JInput on RaspberryPi . Tried Albert’s extended apt-get: but no-joy Tried 2021-05-07-raspios-buster-arm64 from https://qengineering.eu/install-raspberry-64-os.html, but processing would not start. Went back to 32bit raspbian.
• Workaround was to add a second Arduino Uno with a USB host shield and run the Logetech 3D Pro joystick off the shield. Modified the Arduino USB Host Shield Library 2.0 le3dp sketch to have all output include an identifying preamble (J0Y) which allows the processing serialEvent to identify which USB port belongs to the Grbl Arduino and which is the joystick Arduino. Working code is at https://github.com/TPMoyer/Grbl4P and https://github.com/TPMoyer/LE3DP_4_Grbl4P
this puts the jar files in /usr/share/java/ which needs to be added to the CLASSPATH. I am still looking for the .so files which need to be added to the LD_LIBRARY_PATH
I have installed Java 1.7.0_45 on Mac OS X 10.6.8 using Pacifist [http://www.charlessoft.com/] however I am unable to run a jar file which I have downloaded. The jar file is a threaded application.
The error message I am getting is:
java -jar context.jar
2013-10-31 14:14:41.898 java[330:a07] *** NSInvocation: warning: object 0x109356390 of class 'ThreadUtilities' does not implement methodSignatureForSelector: -- trouble ahead
2013-10-31 14:14:41.900 java[330:a07] *** NSInvocation: warning: object 0x109356390 of class 'ThreadUtilities' does not implement doesNotRecognizeSelector: -- abort
Trace/BPT trap
Is there anyway I can run the jar. I have set the JAVA_HOME path properly and java -version is showing 1.7.0_45 as the version.
The same application works properly on Windows Java 1.7.0_45 and also on Linux Java 1.7.
The web search for the solution and the given keywords return very few results and none of them have any specific solution in it. I am new to mac so I am not fully able to understand the issue.
Alternatively, is there anyway I can run Java from folder in Mac like I can do in windows and Linux by just extracting the Java contents and changing the JAVA_HOME. If that is possible then I should be able to run my JAR.
I had kind of same problem while installing an application through jar file, my Java was not detected by the jar application installer,
Over here I see that one of the method is not accessible, could be a same problem. But I am not very sure of it.
make sure you have rt.jar in your JAVA_HOME/jre/lib/ folder
In case you don't have then you are required to have it through the process of creation of symbolic link.
In the command below replace your_java_version with proper version matching your requirement.
sudo mkdir -p /System/Library/Frameworks/JavaVM.framework/Versions/<your_java_version>/Home/jre/lib
Go into the directory:
cd /System/Library/Frameworks/JavaVM.framework/Versions/<your_java_version>/Home/jre/lib/
Create symbolic link :
sudo ln -s ../../../Classes/classes.jar rt.jar
Hope this solves your problem.
I get the exact same problem with MacOS 10.6.8 and JDK 7. In order to run the jar I had to use the System JRE which is 1.6.x (In my case I wanted to install Squirrel
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -jar >squirrel-sql-3.6-MACOSX-install.jar
I have a Java bluetooth server running on a Windows box which I want to port to the Raspberry pi. I have lots of experience with Java but little with Bluetooth or Linux.
The pi currently has Debian Wheezy operating system and I've installed bluetooth and Java ok, and placed the bluecove-gpl and bluecove jars in the classpath.
When I try to run the server, however, Java complains
Native library bluecove_arm not available.
I've tried renaming libbluecove_arm.so from the gpl jar without success, even when setting -Dbluecove.native.path to point to it.
Does anyone know where to find the correct library, what it should be called, and where it should be placed?
[SOLVED}
Found a sh build script on the google code site which showed how to compile the java source files, generate jni headers, compile and link the c files to produce a so library file. Only hiccup was that the library file needed then to be renamed libbluecove_arm.so before it would be found. All done on the pi!
mkdir bluecovelib
cd bluecovelib
wget http://snapshot.bluecove.org/distribution/download/2.1.1-SNAPSHOT/2.1.1-SNAPSHOT.63/bluecove-gpl-2.1.1-SNAPSHOT-sources.tar.gz
tar -zxvf bluecove-gpl-2.1.1-SNAPSHOT-sources.tar.gz
mkdir -p bluecove/target
cd bluecove/target
wget http://snapshot.bluecove.org/distribution/download/2.1.1-SNAPSHOT/2.1.1-SNAPSHOT.63/bluecove-2.1.1-SNAPSHOT.jar
cd ../../bluecove-gpl-2.1.1-SNAPSHOT
ant all
http://privateblog.by/raspberry-pi-kak-rabotat-s-bluetooth-na-java/
When I run MATLAB install script in Ubuntu, I get the following exception:
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class java.awt.Component
longer output is available here
I know that it's a Java problem and could potentially be fixed by changing the classpath or something like that but I don't exactly know how.
Any Ideas?
For me this error was fixed when I installed the JRE on my system:
apt-get install default-jre
on Ubuntu 12.04, instead of having MATLAB use its own.
I've been battling this problem for the whole evening as well but I stumbled onto a solution that works for me at least.
After trying to install using the silent installer I got a different error with a bit more information. It turned out that a library was missing (libXtst.so.6). I was able to install that on my Ubuntu system with:
apt-get install libxtst6
After that I tried running the GUI installer (over X forwarding) and it looks like it's going to work now.
For MATLAB R2012a Student Edition, in Ubuntu 14.04, I had to install these prerequisites first:
sudo apt-get install default-jre libxtst6:i386 libXext6:i386 libxi6:i386 libncurses5:i386 libxt6:i386 libxpm4:i386 libxmu6:i386 libxp6:i386
Next I installed/activated per MATLAB's instructions (sudo ./install). I answered "yes" when the installer asked to add a symbolic link in /usr/local/bin/
Finally, when launching MATLAB, I have to specify that it run in 32-bit mode:
matlab -glnx86
I assembled those steps from this answer: https://askubuntu.com/questions/363878/how-to-install-32-bit-matlab-in-ubuntu-64-bit
and the Ubuntu MATLAB guide:
https://help.ubuntu.com/community/MATLAB
Optional
I didn't want to type the -glnx86 option each time I launch MATLAB, so I replaced the matlab symbolic link in /usr/local/bin/ with a script that automatically specifies the -glnx86 option:
ls -l /usr/local/bin/matlab #note the destination of the symbolic link
sudo mv /usr/local/bin/matlab /usr/local/bin/matlab.bak
#ensure the first path below matches your symbolic link's destination
echo '/usr/local/MATLAB/R2012a_Student/bin/matlab -glnx86 "$#"' | sudo tee /usr/local/bin/matlab
sudo chmod +x /usr/local/bin/matlab
With that, I can type 'matlab' and it launches properly. (The "$#" in the script forwards all input arguments to matlab.) There's probably a more elegant way to accomplish this, but it worked.
I also encountered a "/lib/libc.so.6: not found" error on matlab startup, which I fixed by following this answer.
Installing gnome (sudo apt-get install gnome) fixed this problem for me. I'm sure this was total overkill, but the required libraries are now available.