copied files of a working project give errors - eclipse

I copied some files of a working project into a different project on another computer, everything looks ok but an external jar cannot be resolved. I added jar file as I did on my first project. I tried everytihng (clear project, refresh etc...). It is a google app engine project. I added jar file into WEB-INF/lib. The jar is there but as I said project acts like it isn't there. What should I do?
P.S. I'm using Eclipse Juno.
SOLUTION !:
Hi again, I solved my problem. I first copied jar file into WEB-INF/lib and then I added jar file from Properties/Java Build Path/Add External Jar and problem was fixed.

Solution:
Hi again, I solved my problem. I first copied jar file into WEB-INF/lib and then I added jar file from Properties/Java Build Path/Add External Jar and problem was fixed.

Related

JBoss 6.1.1.EAP Module Deployment: Class not found

The structure is as follows:
Actually deployed module is EAR.
EAR contains WAR module, and WAR module contains another JAR module.
In this last JAR, there are some generated classes and their parent folder is also used as source folder. Its path is "target/generated-sources/java".
The problem that is killing me, is that the deployed application throws ClassNotFoundException on server start, and the classes in question are the generated ones.
Now the trick:
if I explicitly change the Deployment Assembly in WAR project in Eclipse not to contain JAR project as "project", but as an archive from the JAR's project "target" folder, JBoss sees the generated classes and starts.
This solution however works only until next eclipse maven project update, so manual edit of deployment assembly is not really a solution.
Any ideas how to deploy or reorganise packages correctly?
OK, seems I have found the solution.
I looked through the build-path of the mentioned JAR file and saw that the entry Output folder pointed to target/test-classes.
After changing this entry to target/classes the application deploys and starts without any missing generated classes.
This is what worked for me:
Expand the 'target' folder of your maven project inside Eclipse (Project Explorer View);
Refresh it (F5);
Right click on your project on 'Servers' tab, then select "Full Publish";
Start your JBoss.
I had to enforce the JBoss Tool "Full Publish" to get an updated version of my target folder by Refreshing it manually on eclipse.
I don't know why but sometimes the Publishing from maven projects (even Full Publishes) do not copy classes from the target Project as it is in the file system. Maybe it's using some outdated memory info or some cache...
Anyway, this is what works for me.
After an update to Eclipse 4.15 and JBoss tools I got this problem too.
My solution: project -> properties -> Java Build Path --> Source
There my Output folder from my source was linked to project/target/classes, I changed this to project/target/project-projectversion/WEB-INF/classes
When I looked into the standalone JBoss folder I saw the folder structure of my source, but the classes where missing, when I changed the output folder the classes pop up and everything worked like before.
I am pretty sure the update made the problems.

deploy jar Java Desktop Application in jdeveloper12c

I have always developed my java NetBeans projects. When I finish my project, and automatically build "dist" folder where the main jar and a "lib" folder containing all the external jar was created. This is done automatically with the NetBeans IDE
Now I'm trying to do a project with jdeveloper 12c Java Desktop Application and try to deploy my project but I have problems with java.lang.NoClassDefFoundError. I meet several questions:
Can you add the same structure as I said before? That is, a file jar and inside a folder "lib" place the jars using How to do it?
I've seen examples that by New File Group adds refencias, but it really adds to the main jar file (as I see in the size of the file) but not saved in a separate folder.
I do not know if you can help me do this in jdeveloper 12c: Generate a jar file and folder lib with references.
Thank you for your help.
Go into the deployment profile for your project and add all the libraries and files that you need to be included to the JAR you are generating.

Adding new jar in Netbeans project after building the project

I am developing a application in Netbeans7.1. I am facing one problem to add new jar file from the app after building the app.
As i know, when we build the project in Netbeans that will create a "jar" file and "lib" directory (which has all the libraries those are being used in the application) into the "dist" directory.
The problem is, I have to add new jar from my application into /lib/ directory after building the project. So that jar will be used in the application.
How should i do this?
If you have a successful build then it means the jar you wants to add is required at runtime not at compile time otherwise it wouldn't have compiled.
And if above is the case adding jar is straightforward.
Add the jar file to lib folder.
Now open you applications jar with some rar software like winrar.
Goto the META-INF folder open the MANIFEST.MF file and append the class path with lib/new_jar_file.jar.
Bingo..You are done.
Here is a screenshot of MAINIFEST.MF file and red box shows where to add the above mentioned lines.

upload jar file to svn

i have a project in eclipse that i work with SVN.
i need to upload a jar file to "referenced libraries" yet all i managed to do is uploading it to the main directory.
for some reason the file was uploaded to the main server directory instead of to referenced libraries which there it stayed local. i built the file path correctly i think. in the first place the JAR file was only on the referenced libraries.
how can i fix it?
thx
Try using TortoiseSVN. It will show you where you placed the jar and you can make adjustments accordingly.
I usually put the .jar that need to be referenced libraries in a lib directory under the project main directory. This way, when I checkin the project into SVN, the lib directory gets there as well.

jar file got extra ".jar" extension in lib folder

I am facing a weird issue. I don't know whether it is an "apache-tomcat-5.5.25 with Openejb" issue or Eclipse.
I have one Maven project. I do maven clean and maven install. After that I add that project into "apache-tomcat-5.5.25 with Openejb" server and then publish the project into the server.
The problems start here. When I check the published lib folder, I find that some of the jar files have an extra extension of ".jar". For example "xyz.jar" becomes "xyz.jar.jar".
Any ideas why this happens?
Follow the problem upstream: What did Maven produce in it's target folder?
If it's there, too, run Maven with -X, write the log into a file and search that file for the broken JAR name.