I would like to use javax.vecmath in my Java program but unfortunately it says:
The import javax.vecmath cannot be resolved
Should I add the jar by myself in the project? Where can I find that jar file? I'm on Ubuntu/Eclipse Galileo.
On Ubuntu you can apt-get install libvecmath-java. On other systems do what Petar Minchev suggests, or search on Google for something like "java vecmath", which turns up https://vecmath.dev.java.net/, and then go to their downloads page.
Instead of trying to obtain the file through some OS-dependent package,
it would be better to use a dependency manager, for example Maven or Gradle.
Using Maven, you could add this dependency to the pom.xml file of your project:
<dependency>
<groupId>javax.vecmath</groupId>
<artifactId>vecmath</artifactId>
<version>1.5.2</version>
</dependency>
See the latest version of the package on Maven Central.
As the top-voted answer suggests, you can get the jar in Ubuntu with:
apt-get install libvecmath-java
And then you can find the location of the jar file with:
dpkg -L libvecmath-java | grep jar$
Which should output something like:
/usr/share/java/vecmath-1.5.2.jar
/usr/share/java/vecmath.jar
It's really just one jar, the file without version is a symbolic link to the other.
To add a jar to the build path in Eclipse (in a non-Maven project):
Right-click on the project
Select Build Path / Add External Archives...
Browse to the jar file and select it
In other operating systems you can download the jar file directly from Maven Central:
https://mvnrepository.com/artifact/javax.vecmath/vecmath/
Search for the vecmath file, you may find it in /usr/share/java.
Copy the contents of this folder to /jdk_installation_folder/jre/lib/ext.
For me, it is /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext.
To copy you can use either the cp-command or change the ext folder permission to 777 using chmod.
$ chmod 777 /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext
Then copy all the files in file explorer.
$ chmod 755 /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext
If you do did not find the vecmath.jar file, then download and install it.
apt-get install libvecmath-java
Suggestion#1:
libvecmath-java software package provides javax.vecmath vector math package, you can install in your Ubuntu 17.04 (Zesty Zapus) by running the commands given below on the terminal,
$ sudo apt-get update
$ sudo apt-get install libvecmath-java
libvecmath-java is installed in your system.
Make ensure the libvecmath-java package were installed using the commands given below,
$ sudo dpkg-query -l | grep libvecmath-java *
You will get with libvecmath-java package name, version, architecture and description in a table.
Resource Link: http://thelinuxfaq.com/ubuntu/ubuntu-17-04-zesty-zapus/libvecmath-java
Suggestion#2:
Open a terminal and install the Java 3D API. This api is also includes vecmath.jar.
sudo apt-get install libjava3d-java
Resource Link:
https://askubuntu.com/a/626128
https://www.howtoinstall.co/en/ubuntu/xenial/libjava3d-java
Suggestion#3:
You can also download the zip, binary or exe from the following oracle link:
http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-java-client-419417.html#java3d-1.5.1-oth-JPR
Suggestion#4:
In eclipse, step by step installation procedure with pictures, is given in the following link:
https://www.cs.utexas.edu/~scottm/cs324e/handouts/setUpJava3dEclipse.htm
If you are having this issue in an Android project in Android Studio, I had a similar problem and added the following to my dependencies inside of app/build.gradle
implementation 'javax.vecmath:vecmath:1.5.2'
Download(updated) the jar and add it to the classpath. In the linked page it is in the "zip binaries", and there in j3d-jre.zip's lib dir.
Related
I had packaged a jar with all dependencies in it by using Maven assembly plugin, after that I want to edit some configuration files enter code here in vim, but I got below errors when I saved.
error (zip#Write) sorry, unable to update /Users/boreas/IdeaProjects/hummi
ngbird/target/hummingbird-1.0-SNAPSHOT-jar-with-dependencies.jar with log4j.xml
How to solve it?
Make sure you have zip and unzip installed (on Ubuntu you'd run sudo apt-get install zip && sudo apt-get install unzip).
Also make sure the file has write permissions for the current user.
I have followed the instructions for installing a HUB using the Debian package approach. I’ve installed Java on the VM and have it running in a workspace. Now I would like to install the Java bindings for Rappture. Is there a recipe?
used new version of rappture with java bindings. I’ve tested the following installation steps and it should go well.
First, change the /etc/apt/sources.list file. Find the lines pointing to our repository at packages.hubzero.org and change the ‘lenny’ to ‘buck’. ‘buck’ is our testing repository. Don’t change any of the lines for the standard debian repositories.
Next run: apt-get update
Now remove the old version by running: dpkg —purge hubzero-rappture then run: ls -la /apps/rappture You will still see a dated directory for previous version of rappture but it won’t do any harm if you leave it. If there are any links left in that directory then remove those since they’ll cause the new install to fail.
Lastly, run the command: apt-get install hubzero-rappture and your new version should be installed.
To test the new rappture, start a workspace and copy the directory /apps/rappture/examples into your own local directory. Then cd into that the local copy of the directory and run the command: ./demo.bash fermi This will run several version of the fermi demo one of which will be a java version.
After installing opencv 2.4.8.2 with homebrew, I can't seem to find the jar file in /usr/local/Cellar/opencv/2.4.8.2/share/OpenCV
I'm using Mavericks, any ideas?
Probably you forgot to specify --with-java parameter
brew tap homebrew/science
brew install opencv --with-java
After compiling a jar file is in the path
/usr/local/Cellar/opencv/2.4.9/share/OpenCV/java/opencv-249.jar
I solved the question by installing ant (and the other dependencies of opencv) using homebrew and then using cmake to install opencv instead of homebrew. I downloaded opencv from the website then used the following commands:
cd opencv-2.4.8/
mkdir build
cd build/
cmake -DBUILD_SHARED_LIBS=OFF ..
cmake -G "Unix Makefiles" ..
make -j8
The jar will pop out in the following directory:
opencv-2.4.8/build/bin/opencv-248.jar
I had this issue and tried with the --with-java option and it didn't work.
I had to edit the formula (brew edit opencv3) and insert this options myself:
option "with-contrib", "With contrib"
option "with-java", "With java"
Just above the dependency declarations.
You will also have to ensure that -DBUILD_opencv_java=ON is in your args. Note that the value is set to ON not OFF
After you've done this. Uninstall opencv then install it again.
The error could just be because -DBUILD_opencv_java is not enabled. Enable it using brew edit opencv3
I am trying to build Casandra project on a Centos server. I downloaded the file from here.
http://apache.bilkent.edu.tr/cassandra/2.0.6/
Here is the README.txt file
This short guide will walk you through getting a basic one node cluster up
and running, and demonstrate some simple reads and writes.
* tar -zxvf apache-cassandra-$VERSION.tar.gz
* cd apache-cassandra-$VERSION
* sudo mkdir -p /var/log/cassandra
* sudo chown -R `whoami` /var/log/cassandra
* sudo mkdir -p /var/lib/cassandra
* sudo chown -R `whoami` /var/lib/cassandra
Note: The sample configuration files in conf/ determine the file-system
locations Cassandra uses for logging and data storage. You are free to
change these to suit your own environment and adjust the path names
used here accordingly.
Now that we're ready, let's start it up!
* bin/cassandra -f
As README.txt file suggested I followed these instructions as adapting to my case (I am not root).
tar -zxvf apache-cassandra-2.0.6-src.tar.gz
cd apache-cassandra-2.0.6-src
mkdir -p var/log/cassandra
chown -R `whoami` var/log/cassandra
mkdir -p var/lib/cassandra
chown -R `whoami` var/lib/cassandra
Since I am not root on the server, I can not create my files under /var folder. So, I created new folder var under apache-cassandra-2.0.6-src and put my lib and log files there. Then I followed next instructions from README.txt file.
bin/cassandra -f
However whatever I tried it is no good, I always get this error.
Error: Could not find or load main class org.apache.cassandra.service.CassandraDaemon
How can I fix this problem?
My java version
java -version
java version "1.7.0_51"
OpenJDK Runtime Environment (rhel-2.4.4.1.el6_5-x86_64 u51-b02)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
EDIT:
As an extra informaiton, I tried this instructions on my pc, too. Exactly same thing with README.txt file using sudo and it worked.
I see you have downloaded the source package (apache-cassandra-2.0.6-src.tar.gz), but the instructions you posted seem to assume it is already built.
You need to build the source package before you can use it; there would be a separate set of instructions for that somewhere.
I suspect you'd rather just run it instead of building it from source. You may have meant to download the binary package apache-cassandra-2.0.6-bin.tar.gz instead (note "bin", not "src" -- this is a traditional naming convention when separating binaries from source in downloadable archives). With that package you can just run it right out of the box. For the source package you'd need to follow the build instructions to compile cassandra first.
I also suspect that you downloaded the binary package on the PC side, which is why it worked there.
If you do need to build from source:
Install ant and ant-optional if you do not already have it.
Extract the source archive somewhere, then in the base directory (where build.xml is):
ant release
Make a cup of coffee (the rat task at the end takes forever).
Binary archives will be created in build, and a built distribution can be found in build/dist.
do a export CASSANDRA_HOME=location of cassandra
should work in 2.0.6 i verified just then without setting that variable and after setting those variables.
$ export CASSANDRA_HOME=/usr/local/cassandra/dsc-cassandra-2.0.6
$ /usr/local/cassandra/dsc-cassandra-2.0.6/bin/cassandra
or
$ cd /usr/local/cassandra/dsc-cassandra-2.0.6
$ export CASSANDRA_HOME=
$ bin/cassandra
in fact you can also set CASSANDRA_HOME= in cassandra-2.0.6 directory. set it to empty value if you are executing the export command from the cassandra directory.
Path for CASSANDRA_HOME was incorrect for me. After i set the correct path it ran perfectly.
In the cassandra.yaml configuration file, change the
commitlog_directory
data_file_directories
saved_caches_directory
properties to the path you have specified as they are no longer /var/lib...
You will need to set them to point to wherever the directories actually are.
I faced exact problem, where I wanted to install cassandra in userspace without any sudo privileges. I did the following
In cassandra.yaml I changed the following config to local path
commitlog_directory
data_file_directories
saved_caches_directory
log4j.appender.R.File
Installed the "bin" tar files for the particular OS env and not the "src" file.
Export CASSANDRA_HOME=/userspace/cassandra-2.x
Now it works fine for me.
I faced same issue when I used Jdk 1.8_281 version.
The problem was resolved when I downgraded to jdk 1.8_241 version.
I'm looking for a stanadlone application, script or library (better Java) to generate cab files on Linux.
May I ask which distribution you are using?
If you are using Ubuntu, the package cabextract can read and extract a .cab file while the pacakge lcab lets you create one.
You may install the lcab package via the apt-get install command:
sudo apt-get install lcab
You may search the packages you want at Ubuntu Packages Search.
Please let me know if you are not using Ubuntu.
Have a look to lcab or libmspack.