I created lib for my blackberry java app (jar file). But it isn't work.
com.myapp.MyManager: Error!: Missing stack map in: getInstance at label: 31
What is this?
If i copy package of my lib to my blackberry app, it works well. But I need have lib.
You need to preverify the jar file manually. you can do the following to preverify the jar.
execute the following command:
preverify -classpath "JDE_PATH_HERE\lib\net_rim_api.jar" "your_jar_filename"
Read more: http://getablogger.blogspot.com/2009/09/how-to-include-external-jar-file-in.html#ixzz1iTh6g1SF
You can try this link as well .It has instructions on how to do it.
Related
I try to create a Minecraft Plugin (it's my first one) and I can't fix this error:
So, the plugin compiles good but when the code has to execute this code :
BCrypt.checkpw(mdp, result.getString("mdp"))
that come from the lib org.mindrot.BCrypt, I have this error :
Caused by: java.lang.NoClassDefFoundError: org/mindrot/BCrypt
But, when I open my JAR with WinRAR, there is my lib bcrypt (so it's well export). And it's also in my .classpath.
Can you help me ?
Thanks.
There are several ways to configure the CLASSPATH when launching a java application via the java command. According to what you posted so far, I would use the -classpath flag:
java -classpath spigot.jar;jbcrypt.jar class.containing.main.method.MyMain
Alternatively, you could modify the MANIFEST in file spigot.jar. Refer to Adding Classes to the JAR File's Classpath.
Or you could copy jbcrypt.jar to the directory pointed to by the java System property "java.ext.dirs".
Hi Guys I have included the Webcam-Capture API in my project.
When I run it in Netbeans everything works fine. But when i compile everything to a runnable jar i get this message trying to run it by cmd line.
can anyone of you help me?
i already tried to unbound and rebound all jars and changing jdks but its not working
add -classpath flag in the command line ,pointing to the path where Webcam-Capture API exists in your file system, unless you want to create a single package executable.In your case It should be something like below
java -classpath YOURJAR.jar;folder_of_dependant_jar/*;. com.awesome.pagackage.Starter
Where YOURJAR.jar contains the com.awesome.pagackage.Starter.main(String args[])
You also mentioned that your jar is a runnable jar it also means that while exporting/building you can do one of the following way.( NOTE , this feature is in eclipse , but you would get the idea ).Each of the following options you see in the library handling does specific things.
The first option: Extracts the dependent jar into your target jar as java packaging.This means if your package is com.awesome.package and the dependent jar has package logic.package; , after the runnable jar is build you could find both these package exists in your jar file.
The second option: I think it is more on eclipse specific since eclipse adds few classes of its own , of runnable generation, so I am not explaining it here.
The third option : is the most interesting one. it creates folder stucture like below
ndon_lib\external.jar ( external jar file )
ndon.jar ( your jar file )
This time the manifest.mf file contains something like below.
Class-Path: . ndon_lib/external.jar
Main-Class: com.awesome.pagackage.Starter
You should set the classpath
java -cp "your.jar" "yourclass"
I'm trying to build the neo4j GetAll plugin. Project contains only one example class from here.
When I try to run curl http://localhost:7474/db/data/ext/GetAll/graphdb/get_all_nodes, I get the error message:
No such ServerPlugin exception
I'm using neo4j-community-2.2.1 (on Windows) and jdk1.7.0_79.
My project consists of :
GetAll.java in org.neo4j.examples.server.plugins package
META-INF/services/org.neo4j.server.plugins.ServerPlugin file with this content: org.neo4j.examples.server.plugins.GetAll
in buildpath are all jars from %NEO4J_HOME%\lib included.
The jar-file is built using jar -cvf myext.jar * and than that jar placed in %NEO4J_HOME%\plugins.
I have no idea, why I cannot make it work properly. Any suggestions?
The screenshot clearly shows that GetAll.class is located in directory bin/org/neo4j/examples/server/plugins instead of org/neo4j/examples/server/plugins (get rid of the bin).
I'm trying to use R to hook the Java code from the GSRad project. The GSRad Java code is available online and comes as a One-Jar project jar (I was not familiar with One-Jar until today). I can run the One-Jar file just dandy using the following command (after unzipping the file from the above link):
java -jar gsrad_sample.jar
When I pop open the gsrad_sample.jar file I see a jar titled clima_GSRAD-1.0.0.jar in the /lib/ directory which contains the class files I want to hook with R. I've pulled out the jar of my affection and tried the following, to no avail:
library(rJava)
.jinit()
.jaddClassPath( "/home/jal/Documents/DSSAT/gsrad/clima_GSRAD-1.0.0.jar" )
.jnew( "cra/clima/gsrad/GSRBristowCampbellStrategy" )
Any tips on how I might hook the classes inside the clima_GSRAD-1.0.0.jar? I'm flummoxed.
EDIT
The GSRad site requires registration which is annoying. The full zip file which contains the Doxygen documentation for the Java package as well as the One-Jar jar file is available here and if you pop that open the jar that has the classes I want to hook is this one.
Let me preface my answer by saying that I'm no expert in Java / rJava, so apologies if this isn't 100% correct. I hope it's a step in the right direction though.
Start by unzipping gsrad_sample.jar to C:/gsrad (or adjust your paths based on where you unzip it). Then add all the contents of C:/gsrad/lib to your class path:
library(rJava)
.jinit()
.jaddClassPath(dir( "C:/gsrad/lib", full.names=TRUE ))
.jclassPath()
.jnew( "cra/clima/gsrad/GSRBristowCampbellStrategy" )
In Eclipse Indigo (on Mac OSX), I have a project 'Test'. In this project I have a package 'test1'. In this package, I have a class Test.java.
In short the file structure is: Test/src/Test.java and
Test/bin/Test.class
I have a library mylib.jar in lib folder.
I also have a data file named info.dat. In info.dat, there's information about which class to load. For example, in info.dat, I specified: class=Test
then, when I run:
$ java -jar lib/mylib.jar info.dat
(NOTE: this works if I run this command in terminal and have class file in the same folder with info.dat)
the main function in mylib.jar will load Test.class.
I'm using External Tools to achieve this. Here is my External tool setup:
Location: /usr/bin/java
Working Location: /path/to/Test_folder
Argument: -cp . -jar lib/mylib.jar bin/test1/info.dat
However, when I try to run, I get this error:
LOADING INFO FROM FILE bin/test1/info.dat
=> Current directory=[not include because not important]
=> Full pathname=[not include because not important]
java.lang.ClassNotFoundException: Test
I also tried to change class=test.Test in info.dat but got a similar error
java.lang.ClassNotFoundException: test1.Test
The result shows that the info.dat was loaded ok, but the path to class file was not correct. How should I configure the external tool to do what I need? Can someone please give me some instruction?
Many thanks,
It was an easy solution with Run Configuration. I just need to pick the main class from mylib.jar in Java Application and put info.dat in the argument field.
Sorry for wasting the resource here.