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):
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
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
Open a terminal and install the Java 3D API. This api is also includes vecmath.jar.
sudo apt-get install libjava3d-java
Resource Link:
You can also download the zip, binary or exe from the following oracle link:
In eclipse, step by step installation procedure with pictures, is given in the following link:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With