I'm a beginner java developer and i'm not very confident with java world tools.
i'm using eclipse helios, jsdk 1.5, axis2 plugin and tomcat 6.0.29 on windows to port a very old webservice , preaviosuly deployed on a websphere.
I've added a tomcat server to my eclipse project, when i start the server i get the following message : the APR based Apache Tomcat Native library ... etc ... was not found on the java.library.path .
How do i change that variable (or any environment variable in general ) from inside eclipse ?
Then i've another problem i don't know if can be solved with some kind of configuration : i must use some third party .class library grouped togheter into a zip file. I've added the zip to the shared.loader property of the tomcat catalina.properties file and my project can't see them. If i rename the .zip file to .jar everything works fine . How can i use classes inside zip file without renaming it to jar ?
thank you in advance
A Jar is based on the same format as that of Zip. All the third party classes are bundled as Jars (Java Archives) and should be used like that instead of Zip. So if you happen to have a zip housing your classes you should rename it to jar as per java's conventions.
You can check where java.library.path variable is pointing to? using System.getProperty("java.library.path"); and see if the native libs are present in there..you should use the jar instead as its the standard format for archiving java class files
when i start the server i get the following message : the APR based Apache Tomcat Native library ... etc ... was not found on the java.library.path
The exact message is:
INFO: The APR based Apache Tomcat Native library which
allows optimal performance in production environments
was not found on the java.library.path
As you can see, the message is logged as INFO and the easiest thing would be to ignore it, especially in a development environment. But if want to make things more complicated, go to the Apache Portable Runtime (APR) based Native library for Tomcat and follow the install instructions.
(...) I've added the zip to the shared.loader property of the tomcat catalina.properties file and my project can't see them. If i rename the .zip file to .jar everything works fine . How can i use classes inside zip file without renaming it to jar?
In other words, using a (standard) *.jar worked, but a *.zip didn't. I'm tempted to answer: use a .jar extension.
Related
I want to get the version to change the java version automatically.
Because until 1.16 needs java 8 however from 1.17 to launch server needs java 17 etc.
I was tried get manifest and mainclass. and then, get mainclass's major version.
but high version doesn't contain true data in jar. So it cannot get the true version.
I'm sorry for my bad english.
Thank you for reading.
Okay so presuming;
Java application is running in an environment with a bukkit.jar file
You need to retrieve the version of this .jar
If you open a .jar with an archive explorer, like 7zip, you can browse through there..
I went ahead and downloaded craftbukkit-1.19.2.jar and noticed inside of it's META-INF folder is a 'versions.list' file which contains a a single String
a3e1a91200a28b55f64c43b7980830259798984389c782ab8e07364f2e1eb16a *craftbukkit-1.19.2-R0.1-SNAPSHOT.jar
This seems like a good place to start, this String is likely unique in each build.
Otherwise you could access the jar's Manifest and find something in there.
reading MANIFEST.MF file from jar file using JAVA
Why Java Web Start does not download Jar files which specified in resources?
I'm using jdk 1.5 to build my application. There is good reasons to use jdk 1.5 so that I can not upgrade it.
Jdk demo and samples used a servlet to specify location of JNLP and security checking. If I use this servlet, jnlp does not work and its jar files does not download while if write address of jnlp directly in codebase attribute by prefixing file:/localhost/ it works!
I think I found the problem! I was in an exploaded artifact environment which was a location other than actual tomcat/webapps/ROOT so that addresses in jnlp don't match to where they should point to. If I package all JWS in a war file and deploy it manually it works fine.
We are in the process of upgrading from Jetty 9.0.6 to 9.1.1 and are working through the configuration changes to complete the transition. Our application has numerous web contexts deployed, all of which use a common set of libraries (apache commons, logging, specific db, etc) located in an external directory (i.e. - outside of the Jetty deployment).
In Jetty 9.0.6, we included a parameter on start-up which referenced the top level directory for these common libraries:
java -jar .\start.jar lib=M:\common\lib
In the cutover to Jetty 9.1.1 the flag has been changed to --lib. Using the --list-configs we've verified that the directory is in the classpath created by start.jar. However, when the application is started, we are getting numerous ClassNotFound issues. All of these errors are for classes contained in jar files that are located in the common library.
This makes me believe that the flag is for either un-jarred classes or a list of specific jar files. We've also tried using the M:\common\lib* and m:\common\lib*.jar to no avail.
I've searched for any reports of a similar issue, but having found none am asking the question. Does anyone know how to pass all .jar files located in a directory to Jetty 9.1.1 on startup?
I've reported this issue on the Jetty site at the following URL:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=428097
Will continue to track further information about the configuration or the issue from there.
UPDATE:
- This issues has been resolved and merged into the Jetty 9.2 code base. For version 9.1.5 we created a custom module that specifies all the .jar files in the directory and that is working fine (although not ideal).
The commonlib.mod file looks like:
#
# commonlib Module
#
[lib]
M:\commonlib\commons-codec-1.4.jar
M:\commonlib\commons-fileupload-1.2.1.jar
M:\commonlib\commons-io-2.3.jar
M:\commonlib\commons-logging-1.1.1.jar
M:\commonlib\commons-net-2.2.jar
M:\commonlib\commons-pool-1.6.jar
Used the command line to add the commonlib module to the start.ini file (although a manual edit would work just fine too).
I'm using Eclipse Java EE IDE and launch Tomcat from the Server's tab on Eclipse.
Where does Eclipse store generated servlet .java files for JSP files? I've checked the Tomcat installation directory, but nothing there.
Thanks.
Doubleclick the server entry in Servers view and check the path represented by Server path. Explore in there from inside the workspace directory. The generated classes are there.
If you choose the 2nd option Use Tomcat installation, then it will be available Tomcat's /work folder, there where you expected it to be.
go to your application work space directory(not eclipse installation directory) in windows explorer(not in eclipse IDE explorer).
in my laptop it is d:/applicationdata/j2ee
then follow the path as:
work space directory(in my case j2ee)/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work/catalina/localhost
here u will find your application
Eclipse doesn't generate servlet files for JSP files. Validation happens directly on JSP syntax. When a JSP is deployed to an app server like Tomcat, the server may choose to generate servlet files to disk, but that is not required. The generation and compilation can happen in memory or the app server may even compile JSP files directly to bytecode.
I don't know specifically about Tomcat, but if it does generate servlet files to disk, the temporary directory containing these files will be somewhere under your Tomcat install.
/home/waheguru/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work/Catalina/localhost/jspnotes/org/apache/jsp
localhost or your website name,
project name is jspnotes, whatever your project.
This path is shown in Linux Mint.
Check META-INF\context.xml file from your work space. There will be path metioned like below
workDir="C:\apache-tomcat-7.0.39\work"
In above path you will find the package structure of your project and in it there will be both *_jsp.java and *_jsp.class
I've been developing a java application with the eclipse RCP which requires the Java Communications API. Now as the javax.comm has to be setup first (install javax.comm.properties, win32comm.dll and comm.jar) my question ist: How should I deploy my application to make sure javax.comm will be setup on the user's machine? Should I provide an installer which does the setup or should I let the application itself export the files in their respective directories?
I have never before done such a thing, so I'd appreciate any help.
Thanks
I'm using RXTX instead of Java Comm, but the problem is the same, i think. The RXTX site has a documentation about it, please see the Wiki. The description is for Eclipse 3.3, but works for 3.5 too.
How would you like to distribute your application? As a JAR, I assume? In this case you need to setup the JAR's manifest.mf file with a Class-Path entry which contains semicolonseparated relative paths to the desired resources (relative from the JAR file itself on). You can distribute your application with the javax.comm stuff included and if necessary write a readme.txt with installation instructions.