Export a jar file from Eclipse or Command Line - jar

This is my first post ever but I intend to use this more often in the future so please be critical if I do something wrong.
I have done research on the topic and have already attempted everything from using the command line to Eclipse's File>export>jar and choosing the appropriate options.
Basically I have attempted everything suggested in the following two links:
Java: export to an .jar file in eclipse
http://docs.oracle.com/javase/tutorial/deployment/jar/basicsindex.html
The results of my efforts are:
1) a jar file is created
2) when I try to run it the error is "Failed to load Main-Class manifest attribute from test.jar"
I assure you that I have indeed created a "manifest.txt" file in my project that consists of
"Main-Class: Login
"
I even include a newline because I hear that is necessary in some instances.
Does anyone know what I could be missing? Or better yet can anyone please provide an extremely detailed explanation of how to create a jar. This could be either from command line or eclipse.
My current project is setup where I have three java files in my workspace: Login, NewFrame, and NewUser. Login has the main method which will eventually call the other files. These three files are in the default package. The projects name is JavaVersion.
Thanks.

Thank you Antimony for your interest and help. After more tinkering I was able to figure it out for myself. Turns out I was never correctly defining the entry point. For anyone looking to export a jar in Eclipse I would also like to recommend this link.
How do you build a JAR in eclipse with a custom manifest file?

Related

The procedure entry point _Z21qRegisterResourceDataiPKhS0_S0_ could not be located in the dynamic link library

I am trying to create an .exe file from a qt application. The program is running correctly inside the qt creator. I tried to follow the deployment procedure that i find searching the web (for example: https://www.youtube.com/watch?v=8qozxqSZQEg)
However, the .exe file can be run successfully only if it is in the same dir as the compiler (i am using mingw73_32). And the error that i am getting back is the following:
The procedure entry point _Z21qRegisterResourceDataiPKhS0_S0_ could not be located in the dynamic link library.
I would like to point that it seems that no dll files are missing.
Can you please help me to solve this issue?
Thanks a lot,
Your code runs in debugger context, but doesn't run once deployed.
This means that the contexts differ from each other.
Find the difference and the reason for it and you're done.

How can I find unused libraries in a Symfony project with PhpStorm?

I try to find and also to delete all the unused libraries in a project. For example I have a folder lib/ with lot of other folder which are the famous libraries. I want to know how I can identify which libraries are not used.
I asked the same question here but the only response I received suggests to me to check each file one by one ...
Can you help me?
I don't think that is possible, as some libraries may be lazy loaded depending on some internal state of your application.
So even if you could somehow find all strong typed references inspecting the code, you have no way of finding out if a library is loaded via magic methods, custom class loaders, dynamically generated include or require statement, eval-ed code and so on.
Without having tests with 95%+ coverage for your non-library code, it is very risky to remove anything from your lib folder. You code may appear to run fine, but still fail in some edge cases.
There's an open source project that can help you to do that:
https://github.com/composer-unused/composer-unused
Installation
composer require composer-unused/composer-unused-plugin
Usage
composer unused
And if you want to use it inside phpstorm, you can look at their composer documentation: https://www.jetbrains.com/help/phpstorm/using-the-composer-dependency-manager.html#create-and-run-composer-scripts

referencing umbraco 7 source codes

I am trying to figure out some of the functions inside umbraco. The documentation is pretty awful. Can't even find some of the basic example functions definitions.
In example no documentation for creatRegistrationModel, https://our.umbraco.org/search?q=CreateRegistrationModel&cat=documentation
So I found the github downloaded the project. Compiled without issues. I know i can reference the files which i have done for umbraco.dll but not using the file directly, seems pushing it to Temp folder.
Now I want to reference the solution's project .dll files. And debug step by step into the code, is this possible? if i can go tru the code I could see how its calling some of these functions what kinda actions its taking.
Or should I move the projects into my project and reference inside there giving me single project to manage. not sure even if it would work.
Any suggestions?

How to write the scripts for Qt Installer

I'm trying to write my first Qt installer and having trouble. In my installer, in one of the packages, I need to run an .exe file at the end of the installation and add an environment variable as well.
I think the way to do it is with the script option in the package.xml file but I don't know how to write that script, I cannot find a step by step explanation of how to do it anywhere.
Can someone help?
I have been recently suffering the same fate as yourself but have managed, for the most part, to achieve what you are trying to do from the Qt installer framework examples and documentation found here http://qt-project.org/doc/qtinstallerframework-1.5/index.html and http://doc.qt.io/qtinstallerframework/qtifwexamples.html.
The information provided on these pages is a little ambiguous but with a little experimentation you should be able to create the install script that you require.
The package.xml file you would like to implement the install script requires that you add a
<Script>installscript.qs</Script>
tag and that the installscript.qs its self should be located in the meta folder of that package. The installscript.qs will then contain, among a few other things, a
component.addOperation("Execute".....)
command which will execute your required .exe. The same process for the environment variable could be implemented using the execute operation to run a batch file which creates the variable on the users system.
I have been trying over the last few weeks to implement the custom operations detailed in the qt installer framework documentation but have so far been unsuccessful so if you make any progress in this area feel free to pass the information on ;)

Cannot find correct file called qtnetwork4.dll

Guys I've written app in qt and when trying to run it (double click on *.exe) I'm getting error that this application cannot start because qtnetwork4.dll isn't available. I've searched my drive and I found few files with this name (and copied one by one every time trying to run my app) but none of them seems to work. How can I solve it?
place into your *.exe - folder appropriate dll-s from %QT_PATH%\bin\
There is an app called Dependency Walker that will let you know what functions in qtnetwork4.dll are being used in your program. It can be found at the following:
http://www.dependencywalker.com/
All of the DLLs your program use will be from the same installation as the qmake.exe that is used to compile the program. If you are using Qt Creator you can see where the qmake.exe your using is located by going to:
tools->options->Qt4
Get the DLLs that are located at the path displayed here to make sure they will work with your program.
On windows, DLL are looked for in folder where executable lies, then using "PATH" environenment variable.
In your case, you want to put your dll along your executable, taking them from the sdk you're using to compile
The following page provides a lot of additional information on the subject (example, plugins, strategy for building installers)
To force using QtNetwork and linking it, you have to put
QT += network
in your poject file.
If you're sure you're not using it, you can use
QT -= network

Resources