Java Is Installed, in Listing, But Execution Produces "./Java: No Such File or Directory"

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



Leave a reply



Submit