Java compilation problem - path not set

I am compiling the Java program in the Command Prompt then one error has appeared that you did not have set the path of java folder then I also set the path to go in the environment variables but I have the same issue. What should I do to resolve this issue?

Hello Nancy, and welcome to the forums.

A good start would be to open a new thread for new questions.

Besides that, output created by that failed compilation would probably be helpful to determine the cause.
Please use code tags for that and specify the operating system you are using and java version in a new thread.

Regards
Peasant.

It may help to confirm java is installed and what paths are currently set. If you will run the following and post them here this may help us to see how java is configured or what paths need to be added or changed:

$ which java
/usr/bin/java


$ whereis java
java: /usr/bin/java /usr/lib/java /usr/share/java /usr/share/man/man1/java.1.gz

You'll probably want to include the error message you received too, as it probably provides the path that application expecting and not being found. It may also have other helpful information about this problem.

Here are some techniques which is helpful for solve the issue.

1.Find the Java path; it looks like this: C:\Program Files\Java\jdkxxxx\bin\
2.Start-menu search for "environment variable" to open the options dialog.
3.Examine PATH. Remove old Java paths.
4.Add the new Java path to PATH.
5.Edit JAVA_HOME.
6.Close and re-open console/IDE.

Such issues are usually caused by the fact that java installs to e.g. /usr/jdkxxxxx directory but most (but not all) packages look for java in a default directory of /usr/java or /usr/lib/java.

Therefore, a sysadmin needs to create a link so that the default pathname /usr/java actually points to the java version installed path.

Read this thread for the idea:

and see my post#6, although this is referring to fixing a similar issue with java runtime.