Java compilation problem - path not set

Thread Tools Search this Thread
# 1  
Old 10-11-2018
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?

Moderator's Comments:
Mod Comment Please don't hijack others' threads.
Moved pertaining posts to own new thread.
Tried to find an adequate title.

Last edited by RudiC; 10-11-2018 at 04:48 AM..
# 2  
Old 10-11-2018
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.

# 3  
Old 10-11-2018
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

$ 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.
# 4  
Old 10-20-2018
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.
6.Close and re-open console/IDE.
# 5  
Old 10-20-2018
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:
Strange issue installing Java 8

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

Last edited by hicksd8; 10-20-2018 at 04:42 PM..

Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Java compilation error boncuk Programming 2 11-27-2018 01:24 AM
Set java classes path Hscript Programming 3 11-02-2014 10:42 AM
can i have an optimal solution for this java code ? Facing Java heap space problem even at 3GB heaps vaibhavkorde Programming 2 04-12-2011 02:51 AM
How do I set the path davcra UNIX for Dummies Questions & Answers 7 02-19-2011 08:05 PM
Java sting up path problem repinementer Programming 1 01-19-2010 06:19 AM
Problem in compilation. tushar_tus AIX 2 12-01-2009 07:24 AM
C Compilation problem on9west Programming 2 10-14-2009 01:28 AM
Compilation problem Cyr1us AIX 1 05-05-2009 11:40 AM
Not Able to Set the path smartgupta Solaris 7 09-29-2008 01:09 PM
Set java Path adtd8 UNIX for Dummies Questions & Answers 1 06-21-2008 10:57 PM
Compilation problem on HP-UX varuntayur Programming 1 02-19-2008 02:07 PM
compilation problem phani_sree Programming 2 10-25-2007 05:18 PM
compilation problem mansoorulhaq Solaris 0 10-19-2007 09:18 AM
How to set path for java in UNIX subhotech UNIX for Dummies Questions & Answers 2 07-12-2007 11:57 AM
problem in getting the path of environment variable set in bashrc in my shell script krithika Shell Programming and Scripting 8 05-26-2006 09:19 AM