This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General and the fly likes java -classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "java -classpath " Watch "java -classpath " New topic
Author

java -classpath

kamesh aru
Ranch Hand

Joined: Mar 16, 2002
Posts: 150
while compiling used jt400 jar for compliing fallowing code


for compiling javac -classpath jt400.jar IFSListFiles.java its compling with out error

for executing if i use java -classpath jt400.jar IFSListFiles
its giving error
Exception in thread "main" java.lang.NoClassDefFoundError: IFSListFiles

if i put jt400.jar in system class path its working fine my requirment is i need to pass the jt400.jar in the class path
can any one help me out
thanks in advance
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24168
    
  30

If your classpath includes only that one jar, then only classes in that jar will be found -- so your application class won't be found. You need to use a path with multiple entries. On UNIX, use ":" to separate the entries; on Windows, use ";". You can use "." (dot) to mean the current directory. So, for example, something like

java -classpath jt400.jar:. IFSListFiles

By including the "." entry, I'm telling Java to look in the current directory for classes, as well as in that jar.


[Jess in Action][AskingGoodQuestions]
kamesh aru
Ranch Hand

Joined: Mar 16, 2002
Posts: 150
thanks for the reply its working now
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java -classpath
 
Similar Threads
Problems with Packages
Package not found com.ibm.as400.access.*;
NoClassDefFoundError
NoClassDefFoundError
Java calls to RPG functions