Java is installed, in listing, but execution produces ./java: No such file or directory
You're running on a 64bit system without a 32bit runtime environment.
Assuming ubuntu/debian issue:
apt-get install libc6-i386
Or you should install the 64bit version of the package into this VM (which is probably the best solution).
The error message is coming from the run-time linker/loader. if you do a readelf -l java
you will find a line like:
[Requesting program interpreter: /lib/ld-linux.so.2]
Which is what you expect for a 32bit application, and you probably don't have the 32bit environment installed - check with an ls -l of that program interpreter
.
and example for a 64bit program would look like (your system may vary):
[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
If this is not the case, and you do have the 32bit libc installed, you can try an ldd java
, which will give a listing like:
linux-gate.so.1 => (0xf76ef000)
libpthread.so.0 => /lib32/libpthread.so.0 (0xf76b3000)
libjli.so => /home/bubba/java/jdk1.7.0_02/bin/./../jre/lib/i386/jli/libjli.so (0xf769f000)
libdl.so.2 => /lib32/libdl.so.2 (0xf7699000)
libc.so.6 => /lib32/libc.so.6 (0xf751f000)
/lib/ld-linux.so.2 (0xf76f0000)
if there are lines saying not found
then you should add pagkages providing that, but as you can see from this ldd
all the dependencies are core libraries that should be present on practically all linux systems.
Bash can't find an existing file
It turns out we have installed a wrong version of java:
jdk-7u51-linux-x64.tar.gz
instead of the correct
jdk-7u51-linux-i586.tar.gz
one. The nature and cause of the error message still eludes me though.
Executing Java on Ubuntu gives gibberish output
The jars do not need to be executable
On Windows, the semantics are
java -classpath somejar1.jar;somejar2.jar
But on *NIX, the semantics are
java -classpath somejar1.jar:somejar2.jar
*NIX needs colons (:
) not semi-colons (;
).
UPDATE
It looks like your command is incorrectly structured, you said you're doing this:
java BuildPartFour -classpath (...)
Where I'm assuming BuildPartFour is a .class file in the current working directory. This would result in running your BuildPartFour class passing in -classpath (...)
as arguments to your program (these would be visible in the public static void main(String[] args)
args array
It should be this:
java -classpath (...) BuildPartFour
The general java command structure is:
java [options] [class] [args]
Running a Specific Version of Java on the Linux Command Line
Given this is not caused by a permissions issue, it could be the result of a missing 32 bit runtime which is detailed here
Java -version giving me a no such file or directory
you have installed the wrong architecture of java (32bit on top of a 64bit system or viceversa)
Hadoop Cygwin Windows 7 JAVA_HOME Path not found and command not found
Go to environment variable and then advance setting
Go to user variable and setVariable JAVA_HOME and there Value C:\Java\sunjdk6.0.24
Then go to Path and set cygwin path c:\cygwin\bin;c:\cygwin\usr\bin
DO it if not done erlier, If you still facing problem then see Link for Hadoop installation on windows and follow every steps.
Problem changing Java version using alternatives
The only way I was able to solve the problem was to start over again by removing /var/lib/alternatives/java and installing each JDK again. I did the same for javac and jar. After doing this, I was able to switch between versions without any issues.
Related Topics
Limit Decimal Places in Android Edittext
How to Add a Recyclerview Inside Another Recyclerview
What's the Location of the Javafx Runtime Jar File, Jfxrt.Jar, on Linux
Arval SQLexception: Fatal: Sorry, Too Many Clients Already in Postgres
Why Does "While(True)" Without "Thread.Sleep" Cause 100% CPU Usage on Linux But Not on Windows
Why Parallel Execution on Java Compile Take Linear Growth in Time
Webdriver for Firefox: Browser Starts W/ Empty Page, Hangs for 2 Min, Restarts, Then Test Runs. Why
Why Does Java Rmi Keep Connecting to 127.0.1.1. When Ip Is 192.168.X.X
Spring Data JPA Deleteby Query Not Working
Android Eclipse - Could Not Find *.Apk
Android JSONobject - How to Loop Through a Flat JSON Object to Get Each Key and Value
How to Find a Java Thread Running on Linux with Ps -Axl
How to Store Unix Permissions in a Zip File (Built with Apache Ant)
How to Start Using and Developing on Ubuntu Linux
Seeing Too Many Lsof Can't Identify Protocol