I have to run my JAVA programs in UNIX server. The java program uses some external jar files for compiling. I have set the classpath to the folder where all the jar files are present using EXPORT classpath command.
But when i compile, it shows errors.. saying that the classes relating to the jar files are not found.
which means it is not recognising the jar files !!!
You have to name all the JARs on the classpath. Just putting the directory containing the JARs on the classpath will NOT work.
However, if you use JDK 6, you can use a '*' wildcard with the '-classpath' argument to select all jars in a given directory. This feature is not available in earlier JDK versions (5.0 or 1.x).
Thanks, That worked fine for one external jar file. But wen i am using more than one external jar file, i get the following error.
Note: my java program Inbound.java needs 2 jar files jms.jar and com.ibm.mq.jar
and i have jdk 1.4 installed in UNIX server [cant change to JDK 6 ], so i have to go with specifying all the jar files path in command prompt
there is one more problem related to this. When i give javac command with -classpath options, it is compiling and working fine. But the cursor does not come to the command prompt again, unless i press the ENTER key.
i wrote a sample script file to make this more clear
script file
echo before compiling
javac -classpath /full/path/a.jar:/full/path/b.jar classname.java
echo after compiling
the output i get in cmd prompt when i run the script file is as follows
cmdpmt>: before compiling
only after i press ENTER key i get
cmdpmt>: before compiling
after compiling
cmdpmt>:
what is the reason for this ? and how to resolve it, so that i can get the output without pressing ENTER key ?