I developed simple Window application using java.
I used Eclipse Juno as my IDE.
I used Hibernate to do database operations.
Now i want to create the complete setup of this project how can i do it?
I know we can create JAR file using Eclipse using Export option.
But i mean to say i want to create setup in such a way it must include all the things like my database, imported jar files and any other files that are used in my project.
I think it already gets the imported jar file but it is not including database how to include it?
In Visual Studio it remains easy to create setup it gives all the options to include database or not and many other.
How can we do it using Eclipse?
You can try exe4j, installer4j kind of tools to create an .exe or a setup.
But I'm not quite sure whether you can pack your database with the application.
Related
I'm gaining my first experience with Git and its hosting platforms (GitHub etc).
Say, I create a JSP project in Eclipse with some custom files (*.jsp and *.java) and a bunch of auto-generated project files. I need to install an application server as well.
This is an example JSP project in Eclipse. Only the yellow marked files were generated by me:
My colleague wants to contribute to that project. I don't know, what system and what IDE he is going to use.
What exactly do I need to push to Git?
Are only my own files enough? Or do I need to push the entire project, including the files generated by Eclipse?
What if my colleague uses a different operating system, IDE or application server?
Would it make sense to only push the following files?
StudentsBean.java
index.jsp
How would he then need to import them, so that they become executable?
Try creating a new repo and then while creating a repo select git ignore file and type of that file is java or jsp. Then while pushing it will automatically ignore files which are not needed.
i have a java application which uses netbeans' Java DB/Derby.
i have "clean and build" the project creating a jar file, but it'll only run if i explicitly run netbeans and start database there.
how can i set the DB to start up automatically along with jar file and also, that if i sent that jar file to someone else, that database goes along with that(i have read it's possible to do that with derby. not sure though)
any help is appreciated
you need to include sql resources and create the database with these on running the project for the first time . This is a cumbersome process and platform depending ...
there are solutions available that allow for creation of a dictionary in a java project , hence making this platform independ. SAP NetWeaver has this but I'm sure there are others ..
I'm developing an Installer for a project team to reduce the amount of work they have to do installing it manually.
We are using:
Windows 7 x64,
Eclipse Kepler
Right now I'm looking for a way to import a .war file using the commandline.
Is there any way to do this via cmd?
First of all, I would not recommend importing the source code from a file in Eclipse if you have a team of developers, as you would be giving everyone a version that will hardly be actual after some days of work. Using some repository (CVS, SVN, GIT) would be the way to go.
If you have your code in a central repository, then you could make a "Project Set" file in Eclipse wich can be imported easily to setup your whole workspace:
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-cvs-project-set.htm
This project set might have instructions on how to construct the Workspace based on checkouts of the repositories you need.
If you happen to work at a company that uses some X or Y old-fashioned Source Control tool (or worse, none at all), and you have no chances of implementing one that is compatible with Eclipse (like the three I stated above), then the time you are saving with automating the import of a war file will become irrelevant compared to the source code control issues you will be facing (or the team is facing already).
A WAR file is a ZIP file. If you need the content of the WAR you can use the tools for ZIP archives.
A workaround in case eclipse does not have any such options would be to
do a Import WAR through eclipse GUI
check what changes are made to workspace by eclipse (eg. folder created with exploded war file content, configuration files created by eclipse in the folder like .classpath for project folders etc)
Identify the steps and replicate the same through a batch file
Add a call to the batch file in eclipse launch short cut
There is no command line API I know to do this task for Eclipse just from command line, but with the right tools you can achieve what you want.
Please try this:
Straightforward approach that works with any GUI application. You can use AutoIt scripts for interaction with any application. The downside is that GUI may change more frequently than command line API.
Try to create Eclipse project with metadata and unpack WAR file in this project. It can be done, for instance, with Maven or Gradle. Those also can download all dependencies for you.
I'me developping a java agent with Designer 8.5 with external jars in the project.
It works fine except when I close and reopen the project.
Then something quite strange happens: in the project build properties the references to jars are present but not taken in account, so there are compilation errors.
Then if I save a source file and come back to the project properties the references have gone.
So I must use the button "Add external jars" to redeclare them.
Has someone had this problem?
Mikkel Heisterberg has a great summary of the options available to you in regards to Managing external Java dependencies in Domino Designer
Basically, it boils down to:
Include the classes in the agent/web service you are writing
Put the classes in a Java script library and include the script library
Use the JavaUserClasses notes.ini setting
Put the classes in the jvm/lib/ext folder
Was that the information you were looking for? If not, please describe where/how you are using the external jars (Agents, Xpages, Managed Bean, ...).
I've finally managed to create a Netbeans project out of an old standalone (not Web-) Java application which consisted only out of single .java sources. Now I have basically two questions regarding Netbeans Subversion interaction and application deployment:
Do you check in all the Netbeans project files into the repository, normally?
If I build the project using Netbeans (or ant) I get a .jar file and some additional jar libraries. In order for the app to run properly on the server, some additional config files and directories (log/ for example) are needed. The application itself is a J2SE application (no frameworks) which runs from the command line on a Linux platform. How would you deploy and install such an application? It would also be nice if I could see what version of app is currently installed (maybe by appending the version number to the installed app path).
Thanks for any tips.
No, not usually. Anything specific to NetBeans (or Eclipse, IntteliJ, etc), I don't check in; try to make it build from the command line with your ant script and produce exactly what you want. The build.xml is something that can be used for other IDEs, or in use with Anthill or CruiseControl for automated builds/continuous integration, so that should be checked in. Check in what is needed to produce/create your artifacts.
You don't specify what type of server, or what exact type of application. Some apps are deployed via JNLP/WebStart to be downloaded by multiple users, and have different rules than something deployed standalone for one user on a server to run with no GUI as a monitoring application. I cannot help you more with that unless you can give some more details about your application, the server environment, etc.
Regarding the config files, how do you access those? Are they static and never going to change (something you can load using a ResourceBundle)? ? You can add them to the jar file to look them up in the ResourceBundle, but it all depends on what you are doing there. If they have to be outside the jar file for modification without recompiling, have them copied with an installer script.
As for directories, must they already exist? Or does the application check for their existence, and create them if necessary? If the app can create them if absent, you have no need to create them. If they need to be there, you could make it part of the install script to create those folders before the jar files are installed.
Version number could be as simple as adding an about box somewhere in the app, and looking up the version string in a config/properties file. It has to be maintained, but at least you would be able to access something that would let you know you have deployed build 9876.5.4.321 (or whatever version numbering scheme you use).
Ideally, you should not tie down your application sources and config to a particular IDE.
Questionwise,
I suggest you do not. Keep you repository structure independent of the IDE
You might have to change your application so that it's structure is very generic and can be edited in any IDE.
Is this a web app? A standalone Java app? If you clarify these, it would be easier to answer your query.
We don't check in the /build or the /dist directories.
We tend to use this structure for our Netbeans projects in SVN:
/project1/
/trunk
/tags/
/1.0
/1.1
/binaries/
/1.0
/1.1
When a change is need we check out the netbeans project from trunk/ and make changes to it and check it back in. Once a release of the project is needed we do an SVN copy of the netbeans project files to the next tag version. We also take a copy of the deployable (JAR or WAR) and place it in the version directory under binaries along with any dependencies and config files.
By doing this we have a clean, versioned deployable that is separate from the source. Are deployables are version in the name - project1-1.0.jar, project1-1.1jar and so on.
I disagree with talonx about keeping your source non-IDE specific - by not storing IDE files in SVN along with you source you are adding extra complication to the checkout, change, checkin, deploy cycle. If you store the IDE project files in SVN you can simply check out the project, fire up the IDE and hit build. You don't have to go through the steps of setting up a new project in the IDE, including the files you SVNed, setting up dependencies etc. It saves time and means all developers are working with the same setup, which reduces errors and discrepancies. The last thing you want is for a developer to check out a project to make a small bug fix and have to spend time having to find dependencies and set stuff up.
To answer question #2 -- who's your consumer for this app?
If it's an internal app and only you (or other developers) are going to be deploying it, then what you have is perfectly all right. Throw in a README file explaining the required directories.
If you're sending it out to a client to install, that's a different question, and you should use an installer. There are a few installers out there that wrap an ant script and your resources, which is a nice approach particularly if you don't need the GUI... just write a simple ant script to put everything in the right place.
Version number is up to you -- naming the JARs isn't a bad idea. I also have a habit of printing out the version number on startup, which can come in handy.