Go4Expert (http://www.go4expert.com/)
-   Java (http://www.go4expert.com/forums/java/)
-   -   problems with EE (http://www.go4expert.com/forums/problems-with-ee-t24006/)

paul88 27Nov2010 10:16

problems with EE
when running a program I get the following error


javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.fscontext.RefFSContextFactory]
Can anyone help?


virxen 27Nov2010 19:50

Re: problems with EE
is this class in your classpath?

paul88 27Nov2010 22:31

Re: problems with EE


paul@paul-laptop:~/Documents/eprogramming/week5$ echo $CLASSPATH

virxen 28Nov2010 00:13

Re: problems with EE
try placing fscontext.jar and providerutil.jar
JAVA_HOME\jre\lib\ext, where JAVA_HOME is the root directory of your Java 2SDK installation.

paul88 28Nov2010 20:29

Re: problems with EE
Problem solved.

The problem was that when I was running the program I was saying


java -cp . name
What i didn't know was that was saying ignore the class path any only have class path as . dot for current directory. which was making it pointless adding the jar files to the classpath.

Before I just run java like this as the class not found error came up.

I amended the CLASSPATH with the dot. So all I need to type was java name.

Thank you for your help

All times are GMT +5.5. The time now is 00:33.