This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, I'm trying to use MathFP class for allowing my application use float and double. My problem is: how can I include this new class (or package) in my application. Do I have to change the settings of my CLASSPATH ? Do I have to do it by changing the Autoexec.bat ? Thank you! bye, Alfredo
What you are doing is getting an extension for the Java Language. You can put the jar file for that extension in jre/lib/ext in which case it will be an "installed extension" and the jvm will be able to find it, or you can name the extension jarfiles in the manifest file that is used to invoke your jar file and they will be used as part of the application.
"JavaRanch, where the deer and the Certified play" - David O'Meara
Joined: Nov 19, 2001
Your answer was very useful for me and I thank you but I have another little problem now: I put my package tree in a jar file. I placed the jar file in the "lib/ext" directory. At this point I don't have the compiling problem no more (the 'import net.jscience.math.*;' at the top of the program doesn't cause no problem). But if I try to use a class inside the package imported or if I import just that class ('import net.jscience.math.MathFP;') I have this run-time problem: "UNABLE TO LOAD CLASS net.jscience.math.MathFP" like if that class doesn't exist in the package! thank you, bye Alfredo ps. Maybe it's useless: I'm working on WinNT, with the J2me Sun ToolKit and with the Zucotto Whiteboard for J2ME.
Joined: Sep 29, 2000
Can you check if you are spelling the class correctly. Use >jar tf jar-file to view the table of contents for the jar file.