could you help me to change this command line to use it in a MacOS? the jar files will be on the desktop.
java -classpath jooq-2.0.0.jar;jooq-meta-2.0.0.jar;jooq-codegen-2.0.0.jar;mysql-connector-java-5.1.18-bin.jar;. org.jooq.util.GenerationTool /guestbook.xml
Thank you.
F.
UPDATE:
ok, this is the full lines and the error that I got. All the listed jars are present in the folder:
java -classpath ~/Desktop/JOOQ/jooq-2.1.0.jar:~/Desktop/JOOQ/jooq-
meta-2.1.0.jar:~/Desktop/JOOQ/jooq-codegen-2.1.0.jar:~/Desktop/JOOQ/
mysql-connector-java-5.1.15-bin.jar:. org.jooq.util.GenerationTool /bookstore.xml
Exception in thread "main" java.lang.NoClassDefFoundError: org/jooq/
util/GenerationTool
Caused by: java.lang.ClassNotFoundException:
org.jooq.util.GenerationTool
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
UPDATE 2
If I change the path removing ~/ and usign:
java -classpath /Users/fabio/Desktop/JOOQ/jooq-2.1.0.jar:/Users/fabio/Desktop/JOOQ/jooq-meta-2.1.0.jar:/Users/fabio/Desktop/JOOQ/jooq-codegen-2.1.0.jar:/Users/fabio/Desktop/JOOQ/mysql-connector-java-5.1.15-bin.jar org.jooq.util.GenerationTool /Users/fabio/Desktop/JOOQ/bookstore.xml
I got a different error:
Apr 1, 2012 5:19:52 PM org.jooq.tools.JooqLogger error
SEVERE: Cannot find /Users/fabio/Desktop/JOOQ/bookstore.xml
Apr 1, 2012 5:19:52 PM org.jooq.tools.JooqLogger error
SEVERE: -----------
Apr 1, 2012 5:19:52 PM org.jooq.tools.JooqLogger error
SEVERE: Please be sure it is located on the classpath and qualified as a classpath location.
Apr 1, 2012 5:19:52 PM org.jooq.tools.JooqLogger error
SEVERE: If it is located at the current working directory, try adding a '/' to the path
Apr 1, 2012 5:19:52 PM org.jooq.tools.JooqLogger error
SEVERE: Usage : GenerationTool
You can prepend the full path to each jar file (e.g. ~/Desktop/), and you also need to replace the windows classpath separator (semicolon, ';'), with the UNIX/MAC separator (colon, ':'). For example:
java -classpath ~/Desktop/jooq-2.0.0.jar:~/Desktop/jooq-meta-2.0.0.jar:~/Desktop/jooq-codegen-2.0.0.jar:~/Desktop/mysql-connector-java-5.1.18-bin.jar:. org.jooq.util.GenerationTool /guestbook.xml
Ok found. Commands to use:
cd /Users/fabio/Desktop/JOOQ
java -classpath /Users/fabio/Desktop/JOOQ/jooq-2.1.0.jar:/Users/fabio/Desktop/JOOQ/jooq-meta-2.1.0.jar:/Users/fabio/Desktop/JOOQ/jooq-codegen-2.1.0.jar:/Users/fabio/Desktop/JOOQ/mysql-connector-java-5.1.15-bin.jar:. org.jooq.util.GenerationTool /bookstore.xml
The ':.' after the last jar file is required.
Thank you.
Related
I have this class initialiser:
System.setProperty("java.library.path", "C:\\Users\\lucas\\Desktop\\libraries");
System.loadLibrary("libTTARCHHelper");
TTARCH_LIBRARY=(TtarchLibrary)Native.loadLibrary(TtarchLibrary.class);
And the DLL is located at C:\\Users\\lucas\\Desktop\\libraries\\libTTARCHHelper.dll
If I run this in Eclipse I get 'The specified module could not be found' and if I run it as a JAR I get 'no libTTARCHHelper in java.library.path'.
How do I fix these? I even tried putting the DLL in a folder in the PATH environment variable.
Full debug using the file direct load:
Aug 26, 2020 12:28:51 AM com.sun.jna.Native extractFromResourcePath
INFO: Looking in classpath from jdk.internal.loader.ClassLoaders$AppClassLoader#c387f44 for /com/sun/jna/win32-x86-64/jnidispatch.dll
Aug 26, 2020 12:28:51 AM com.sun.jna.Native extractFromResourcePath
INFO: Found library resource at jar:file:/C:/Users/lucas/Desktop/My%20Stuff/Eclipse%20Workspaces/Build%20Paths/jna-5.6.0.jar!/com/sun/jna/win32-x86-64/jnidispatch.dll
Aug 26, 2020 12:28:51 AM com.sun.jna.Native extractFromResourcePath
INFO: Extracting library to C:\Users\lucas\AppData\Local\Temp\jna-103324076\jna5931694657592960137.dll
Aug 26, 2020 12:28:51 AM com.sun.jna.NativeLibrary loadLibrary
INFO: Looking for library 'C:\Users\lucas\Desktop\libraries\libTTARCHHelper.dll'
Aug 26, 2020 12:28:51 AM com.sun.jna.NativeLibrary loadLibrary
INFO: Adding paths from jna.library.path: null
Aug 26, 2020 12:28:51 AM com.sun.jna.NativeLibrary loadLibrary
INFO: Trying C:\Users\lucas\Desktop\libraries\libTTARCHHelper.dll
Aug 26, 2020 12:28:51 AM com.sun.jna.NativeLibrary loadLibrary
INFO: Loading failed with message: The specified module could not be found.
Aug 26, 2020 12:28:51 AM com.sun.jna.NativeLibrary loadLibrary
INFO: Adding system paths: []
Aug 26, 2020 12:28:51 AM com.sun.jna.NativeLibrary loadLibrary
INFO: Trying C:\Users\lucas\Desktop\libraries\libTTARCHHelper.dll
Aug 26, 2020 12:28:51 AM com.sun.jna.NativeLibrary loadLibrary
INFO: Loading failed with message: The specified module could not be found.
Aug 26, 2020 12:28:51 AM com.sun.jna.Native extractFromResourcePath
INFO: Looking in classpath from jdk.internal.loader.ClassLoaders$AppClassLoader#c387f44 for C:\Users\lucas\Desktop\libraries\libTTARCHHelper.dll
Aug 26, 2020 12:28:51 AM com.sun.jna.NativeLibrary loadLibrary
INFO: Loading failed with message: Native library (win32-x86-64/C:\Users\lucas\Desktop\libraries\libTTARCHHelper.dll) not found in resource path (C:\Users\lucas\eclipse-workspace\TEST\bin;C:\Users\lucas\Desktop\My Stuff\Eclipse Workspaces\Build Paths\jna-5.6.0.jar)
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'C:\Users\lucas\Desktop\libraries\libTTARCHHelper.dll':
The specified module could not be found.
The specified module could not be found.
The rest of the trace:
Native library (win32-x86-64/C:\Users\lucas\Desktop\libraries\libTTARCHHelper.dll) not found in resource path (C:\Users\lucas\eclipse-workspace\TEST\bin;C:\Users\lucas\Desktop\My Stuff\Eclipse Workspaces\Build Paths\jna-5.6.0.jar)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:301)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:461)
at com.sun.jna.Library$Handler.<init>(Library.java:192)
at com.sun.jna.Native.loadLibrary(Native.java:646)
at com.sun.jna.Native.loadLibrary(Native.java:630)
at com.test.TTARCHHelper.<clinit>(TTARCHHelper.java:17)
at com.test.main.main(main.java:6)
Suppressed: java.lang.UnsatisfiedLinkError: The specified module could not be found.
at com.sun.jna.Native.open(Native Method)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:191)
... 6 more
Suppressed: java.lang.UnsatisfiedLinkError: The specified module could not be found.
at com.sun.jna.Native.open(Native Method)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:204)
... 6 more
Suppressed: java.io.IOException: Native library (win32-x86-64/C:\Users\lucas\Desktop\libraries\libTTARCHHelper.dll) not found in resource path (C:\Users\lucas\eclipse-workspace\TEST\bin;C:\Users\lucas\Desktop\My Stuff\Eclipse Workspaces\Build Paths\jna-5.6.0.jar)
at com.sun.jna.Native.extractFromResourcePath(Native.java:1095)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:275)
... 6 more
So it looks like it doesnt find it , It throws a
java.lang.UnsatisfiedLinkError: The specified module could not be found.
I found the problem, the DLLs were for the wrong bit. Eclipse runs on 64 and the JAR uses the 32bit JVM. I downloaded the 32 bit dlls too and now it works when I run the JAR. However the 64 bit dlls in Eclipse keep throwing the module exception above
JNA will look for libraries at locations in the jna.library.path environment variable.
One option is to specify it as a command line option in Eclipse's run configuration. In the Run menu, select Run Configuration. Go to the (x)=Arguments tab. Add this in the VM arguments field:
-Djna.library.path=C:\Users\lucas\Desktop\libraries
You can also programmatically set it in your code before attempting to load the DLL:
System.setProperty("jna.library.path", "C:\\Users\\lucas\\Desktop\\libraries");
As you later indicated with the debug log, it may be finding the DLL but failing to open it. Possible reasons for this can be:
The DLL is runtime-dependent on another DLL on your system that's not in the appropriate path(s). A common one is the Visual C++ Distributable.
You may need to consult the DLL documentation for more information. You can sometimes use Process Monitor from the SysInternals library to try to see what it's opening.
Having a duplicate/incompatible version of a dependent DLL as above
Running a 64-bit JVM and trying to open a DLL that's not 64-bit compatible, or vice-versa
Your Java program may not have permission to read the directory where your library is located
To help diagnose the problem, look at the full stack trace. While the most recent error message may not be relevant (file not found in a "backup" search) if you look down the trace you may see multiple suppressed exceptions from earlier attempts to open a DLL which may give you more informative debugging information.
I encounter a problem when I tried to run a simple rest web service.
Information:
Java platform: 1.6.0_38
Oracle IDE: 11.1.1.9.40.71.67
Below is the error message:
<Apr 18, 2018 7:28:24 PM PDT> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.application.ModuleException: Failed to load webapp: 'lib-RESTWebService-context-root'
at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:395)
at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:517)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassNotFoundException: oracle.adfinternal.view.faces.taglib.region.RichDeclarativeComponentTag
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:64)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Truncated. see log file for complete stacktrace
I searched a lot but failed to find a solution, could you please give your advice on it?
Thanks!
This particular class
oracle.adfinternal.view.faces.taglib.region.RichDeclarativeComponentTag
is part of the ADF Faces Runtime 11 library. Add it up to your project.
Also Make sure to add
javax.faces.context.ExternalContext
class , which is part of the Java EE 1.5 API library.
Also add JSF 1.2 library to your project.
On every server startup I get the following error:
GRAVE: Unable to process Jar entry
Mai 15, 2017 10:39:31 AM org.apache.catalina.startup.ContextConfig processAnnotationsJar
GRAVE: Unable to process Jar entry [fr/package/model/someClass.class] from Jar [jar:file:/C:/Folder-dev/work/eclipse/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/web/WEB-INF/lib/package-model-0.0.1-SNAPSHOT.jar!/] for annotations
java.io.EOFException
This was a well known error that was caused by some incompatibility issues between TOMCAT 7 & JDK <= 6.
In my case I'm working with this configurations:
Server number: 8.0.9.0
Server version: Apache Tomcat/8.0.9
Architecture: amd64
JVM Version: 1.8.0_131-b11
Can anyone help me to solve this issue ?
I upgraded to tomcat 8.5 and everything works fine.
I am getting this error while clicking on the neo4j.bat file in Windows. I tried other answers on stackoverflow but none of them is working. I set all variables in path JAVA_HOME & JRE_HOME. It says database incorrectly shutdown, performing recovery. And then console goes off. I have installed jdk 1.7 & jre7.
Sep 15, 2013 11:52:57 PM org.neo4j.server.logging.Logger log
INFO: Setting startup timeout to: 120000ms based on -1
Sep 15, 2013 11:52:58 PM org.neo4j.server.logging.Logger log
SEVERE:
java.lang.RuntimeException: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.StoreLockerLifecycleAdapter#3e890800' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:280)
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:106)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:88)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:207)
at org.neo4j.kernel.impl.recovery.StoreRecoverer.recover(StoreRecoverer.java:114)
at org.neo4j.server.preflight.PerformRecoveryIfNecessary.run(PerformRecoveryIfNecessary.java:59)
at org.neo4j.server.preflight.PreFlightTasks.run(PreFlightTasks.java:70)
at org.neo4j.server.AbstractNeoServer.runPreflightTasks(AbstractNeoServer.java:280)
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:160)
at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:86)
at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:49)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.StoreLockerLifecycleAdapter#3e890800' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:497)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:104)
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:258)
... 10 more
Caused by: org.neo4j.kernel.StoreLockException: Could not create lock file
at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:74)
at org.neo4j.kernel.StoreLockerLifecycleAdapter.start(StoreLockerLifecycleAdapter.java:40)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:491)
... 12 more
Sep 15, 2013 11:52:58 PM org.neo4j.server.logging.Logger log
SEVERE: Failed to start Neo Server on port [7474]
Most likely, you have an instance already running. Kill any Java processes and try again.
I have created a program in eclipse which I have exported to JAR but when I try to run it i am getting the following error:
Error: Could not find or load main class
I don't understand why it cant find it as I have stated where the main class is. my Manifest file looks like this:
Manifest-Version: 1.0
Main-Class: gui.GeoMapItMain
Class-Path: mysql-connector-java-5.1.25-bin.jar
Class-Path: JMapViewer.jar
Class-Path: colt.jar
Class-Path: metadata-extractor-2.6.4.jar
Class-Path: JMapViewer_src.jar
SplashScreen-Image: images/splash.gif
I am using java on a Mac with Mountain Lion with the following versions of JDK:
javac 1.7.0_13
java version "1.7.0_13"
I have now tried this:
java -jar GeoMapItJ.jar
which gives me an error as follows:
Exception in thread "main" java.lang.NoClassDefFoundError: org/openstreetmap/gui/jmapviewer/interfaces/MapMarker
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2451)
at java.lang.Class.getMethod0(Class.java:2694)
at java.lang.Class.getMethod(Class.java:1622)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: org.openstreetmap.gui.jmapviewer.interfaces.MapMarker
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 6 more
The problem is that the syntax for Class-Path in a manifest requires the entries to be space-separated, not to be on separate lines. See the JAR File Specification.
Having multiple Class-Path keys is an error. The jar tool will warn you if you pass it the verbose flag:
$ jar cvfm foo.jar manifest Foo.class
Jun 12, 2013 9:53:19 PM java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: Class-Path.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
Jun 12, 2013 9:53:19 PM java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: Class-Path.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
Jun 12, 2013 9:53:19 PM java.util.jar.Attributes read
...
The extra Class-Path entries are being ignored, which causes the exception
java.lang.ClassNotFoundException: org.openstreetmap.gui.jmapviewer.interfaces.MapMarker
because the class is not specified in the Class-Path entry that is processed.