Results 1 to 11 of 11
- 02-19-2010, 09:43 AM #1
how to a class if dont have its .java file.
In eclipse
.java files reside in "src" folder and .class file reside in "bin" folder.
i have a class name "a.class" in bin folder, of which i dont have source file or .java file.. now i want to use this a.class in another java program.
is it necessary to have source file also . coz whenever i use this a.class file in other program i get error.. how to use it without its .java file
- 02-19-2010, 10:23 AM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
You will need to add the class to your classpath.
Best is to package the class into a jar file and add that jar file to your project's build path.
- 02-19-2010, 10:25 AM #3
can you please explore in steps , how to do this .You will need to add the class to your classpath.
Best is to package the class into a jar file and add that jar file to your project's build path.
- 02-19-2010, 10:30 AM #4
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Google "how to create a jar file" and read the first link that comes up.
- 02-19-2010, 10:58 AM #5
i made jar ... added external jar to build path.. and now the erroe is
Java Code:Exception in thread "main" java.lang.NoClassDefFoundError: com/asprise/util/ocr/OCR at Hi.main(Hi.java:21) Caused by: java.lang.ClassNotFoundException: com.asprise.util.ocr.OCR at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 1 more
- 02-19-2010, 11:10 AM #6
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
You need the asprise.jar file to be on your classpath when running the application.
- 02-19-2010, 11:21 AM #7
And how can we do this ?You need the asprise.jar file to be on your classpath when running the application.
- 02-19-2010, 11:29 AM #8
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
The same way you added the external jar to the build path.
- 02-19-2010, 11:56 AM #9
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
The same way you added the external jar to the build path.
- 02-19-2010, 12:17 PM #10
asprise.jar ?
the jar i made is OCR.jar. i dont have any jar called asprise.jar
- 02-19-2010, 12:24 PM #11
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Similar Threads
-
need help.. java class file...
By Madz in forum New To JavaReplies: 3Last Post: 11-21-2009, 03:42 AM -
java.util.Formatter doesnt seem to create a file for me incase I dont have one..
By Addez in forum New To JavaReplies: 10Last Post: 11-01-2009, 09:42 PM -
converting java class file to exe file
By satheeshtech in forum Advanced JavaReplies: 5Last Post: 07-18-2009, 11:47 PM -
.class file to .java file
By makpandian in forum New To JavaReplies: 1Last Post: 02-20-2009, 06:46 PM -
dont let me create simple class
By itaipee in forum New To JavaReplies: 5Last Post: 01-11-2009, 11:07 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks