how to add blackberry library into blackberry-eclipse-plugin project? - java

when i try to include blackberry library into project i see that happen nothing happen and error like pic
where i try this:-
preverify it by
preverify.exe -classpath [JDE_PATH]\lib\net_rim_api.jar myjarfile.jar
and try this
preverify.exe -classpath [JDE_PATH]\lib\net_rim_api.jar; myjarfile.jar
myjarfile.jar in bin folder
after that i but it into my project in lib source folder as pic and check order and export checkbox true
- i have ksoap2-j2me-core-prev-2.1.2.jar already preverify but the only difference that "myjarfile" is blackberry library and the "ksoap" is j2me
please help
any new answers???

Kindly change the compiler compliance level to 1.4 in project properties ( in java compiler ).

If you can get the source for this library, you can follow the details I have in another answer:
BlackBerry - use own JAR file in own project
You might find something useful on that page.
I'm sorry I haven't included any real answer in this post, because I don't know exactly what you want, and the details on that other link are very long.

Related

Export Java Class from Path

I want to export Code out of my Eclipse Project, only knowing the path to.
The Path looks like
net.sf.jabref.gui.ImportInspectionDialog.ImportInspectionDialog(JabRefFrame,BasePanel,String[],String,boolean)
How can i afford to export the Code of this url, into a new File ?
Best regards
Ask your favorite search engine and you will see that the code for jabref is available at github. Take a look at the code of that class here.
If you use maven to manage/import your dependencies, you can select "download sources" in the eclipse maven settings. That causes the classes to always come with the source code when available.
I don't understand what you mean by "export", but you can copy the code to your own java file.

How to use jmlc, jmlunit with OpenJML?

I have installed OpenJML tool (http://openjml.org/) for the Eclipse and was using it and it worked quite well.
However, now I need to call the jmlc and jmlunit tools from command line. As I see from the search in Internet these tools should be located at some directory of JML,I should add them to PATH and use normally by calling the corresponding commands. But once I download OpenJML I have only 3 jar files and no directory at all. Also, from the official JML page there is no other link to download some other version rather than OpenJML. It seems to me that I don't get something obvious.
So, the question is how I can find these tools to run them on command line?
Thanks in advance.
For jmlc, use the -compile flag.
You can also add it as in alias in your ~/.bash_profile:
alias jmlc="java -jar $JML_HOME/openjml.jar -compile"

Not sure where to put my Java library needed for my class assignments

I'm starting a Java programming class at UCSD next week and I'm trying to prepare over the weekend. There is a library called objectdraw.jar which comes with the book we will be using for our class projects. I am currently using Vim for my Java projects because most assignments will be simple and I am still trying to learn and master Vim.
Now to the question:
In C++ I am able to use #include with angled brackets <> to include headers in a default folder and #include with quotes "" to include local header files. It seems from what I've found with some Internet searches that you can't do that with Java.
I tried putting the objectdraw.jar file in the same folder as my .java file for the first assignment, but it doesn't find the library using the following code:
import java.awt.*;
import objectdraw.*;
When I searched online, the Gentoo HOWTO mentioned setting a CLASSPATH but then mentions that those instructions should be considered deprecated, but doesn't provide further instructions.
The website where I downloaded the library http://eventfuljava.cs.williams.edu/library.html does not provide instructions for Vim, but does for other IDEs like Eclipse and Netbeans.
Can anyone tell me where I would place the .jar file to ALL my projects can find it, or can anyone point me to a resource where I might find an answer. I seem to be asking the wrong questions when searching online.
Thanks!
Look here for how to set classpath using command line options to any of the java sdk tools - java, javac. The page shows how to set the environment variable CLASSPATH as well as how to use the switch -classpath.
In your case if you have the objectdraw.jar in the same directory as your source files, then you will need a command like this to compile -
javac -classpath . MyClass.java
and this to run
java -classpath . MyClass
You can also provide the full path to a jar file in the classpath and add multiple directories and jars. Such as -classpath .:/path/to/my.jar:/some/other/directory note paths and separators for *nix environment. on Windows it would be ; and \
Edit: Note comment below for quoting paths with spaces in them.

where to place jar in order to run a program from command-line?

this will sound silly but i am executing my code from command prompt and have to use a jar in my class.
I have placed my jar in lib folder of JDK..
but i am still getting error of file not found
any explanation??
EDITED : guys tried all but still not working
EDIT 2 :i am trying to work as was told by this link i am using js-1.6R5.jar
Edit 3 : i undestand all the things you ppl have told but nothing working for me.. pls give me a link to upload my example that i can share with you all.
Edit 4 : i am fed up by setting classpaths but its not working... i have SDK installed in my system, do i need an extra JDK to run my programs from command prompt??
You need to add the jar to the class path by doing the following...
java -classpath D:\myprogram;D:\myprogram\lib\supportLib.jar org.mypackage.HelloWorld
Please see Wikipedia - Classpath_(Java)
You can place it anywhere, as long is you include it in your classpath. See Setting the Class Path for how to include jars in the classpath.
Have in mind that adding something in the JDK lib is almost never a good idea.
You can make a lib folder in your application's directory and put jar files there, then make your application find them by adding lib to your application's classpath.
And, don't put your jar files in JDK's lib folder. It's not good practise.
You need to let Java know that you want to include the jar in your classpath (the list of folders and jars it checks for classes). One way to do this is with the -cp command line argument, something like
java -cp ".;pathToMyJar\myJar.jar" MyClass
Another is to edit the CLASSPATH environment variable in your OS to include your jar.
A simple solution will be to place the jar fiel inside the windows folder if you are doing it in a Windows machine.
Unfortunately your question contains a lot of question signs and few information.
If you are using java.io.File to open jar as a regular file this jar should not be in lib directory. You just have to provide correct path in file system.
If however you are just trying to use jar as a part of your application it should be in classpath. Use either command line java -cp myjar.jar MyMainClassor put full path to this jar to global environment variableCLASSPATH`.

MinGW GCJ libiconv path problem

I'm having a problem with the MinGW implementation of GCJ. I read that you have to install libiconv before you can use it. However, the documentation wasn't very specific, and it did not say where to extract the binaries and developer files (libiconv-bin and libiconv-lib). I have tried the following paths:
$p = c:\mingw
$p\libiconv-1.9.2-1-[bin|lib]\
$p\libiconv-[bin|lib]\
$p\mingw32\libiconv-1.9.2-1-[bin|lib]
$p\mingw32[bin|lib]\libiconv
$p\mingw[bin|lib]\liconv
$p\bin\libiconv-1.9.2-1-[bin|lib]
$p\bin\libiconv-[bin|lib]
None of these work. Any help on where I'm supposed to put the libiconv files?
Extract the libiconv-* into the same directory as MinGW.
You can extract the libiconv-* into a folder first, then copy all the sub-folders in to your MinGW directory.

Categories