Eclipse - difference between these installation methods? - java

I am wanting to install eclipse for study/school purposes. I am after "Eclipse for Java".
On the eclipse website, there seems to be two ways to achieve this:
(a) Use the eclipse installer (where you choose which eclipse you want to download and it does it for you)
(b) go the the 'dowload packages' page, download a zip file e.g. "java-neon-64-windows.zip" and then unextract the zip
I tried both of these methods. However, the resulting eclipse folders from both these installations is of different sizes.
Method (A) installation was 20.7MB
Method (B) installation was 192MB
Please clarify what causes this huge difference and which one of these should I use for my purpose??
Thanks

The zip is a standalone (for example if you don't have admin rights) on your laptop. The other is a standard installer, which is still gonna be heavy but use the architecture of the system to install in a more "standard way". On Windows, a program folder's size, in C:Program Files, is not the size of the full application by the way.

Eclipse installer stores the Eclipse plugins on a different location than your Eclipse product's directory tree. This allows installer to create multiple Eclipse products without downloading all the plugins again. You can probably find the plugin pool under ~.p2/pool.

Related

How to make an Executable ".exe" file from a java Code

I have an application that works fine and that I can execute from a .jar file. But I want to know how to make it runnable from any computer even if there is no JRE or the JRE version is not the good one. I thought about a .exe file but don't know how to do it.
I made my code with Eclipse and it use jxl,jdom and jfx librairies.
I tried to use Inno Setup 5.5.6 but when in Eclipse I run my build.xml as Ant Build it return me an error that says :
"'Launching JFX Build - Myapp' has encountered a problem.
The achive : C:/Program%20Files/eclipse/plugins/org.eclipse.swt.win32.win32.x86_64_3.104.0.v20150528.jar which is referenced by classpath, does not exist."
JavaFX provides specific utilities for bundling your application as a native package, which is referred to as "Self contained application packaging". These utilities are provided as a command-line tool, or as ant tasks. Additionally, the common IDEs support this via wizards, either out of the box (NetBeans) or via a plugin (e(fx)clipse for Eclipse). The details of how to use any of these are far beyond the scope of a stack overflow question, but the basic documentation is available here. A tutorial for e(fx)clipse is here.
Briefly, for e(fx)clipse, you should double-click the build.fxbuild file that is created in your project. Under the "Overview" tab, find the "Packaging format" option, and select "All" (or the specific type of package you want to create).
Note that you can only create a package targeted at the platform on which you are building, so if you want to create packages for windows, Mac, and Linux, you will need access to all three types of machine.
I know I am late. I faced same problem a trick worked for me. Look at the given directory in the error message. It contains a space (C:/Program Files/...). Move your e(fx)clipse to another directory where the directory doesn't contains any space.
Not sure it will work your everyone or not but it worked for me.
Thanks
There are various tools that let you wrap your Java application in a Windows executable. Some tools are only simple installers, others allow you to bundle your application with a specific JRE version.
A widely used but commercial tool is install4j, but there is a bunch of other tools, such as WinRun4J.

NetBeans doesn't find projects on OneDrive

I have a pc and a laptop both running Windows Pro 8.1 and latest version of Netbeans. I log on the pc and the laptop with the same hotmail/windows account. I build my java projects on the pc and i save them on a OneDrive directory just fine all working ok. BUT when i try to open them on my laptop NetBeans sees the folders with all the files in them but doesnt find the projects so it is unable to open them. So i cant edit or work on any of my projects on my laptop. Is using a usb drive to save my projects my only way to mobility?
Turn off "Compile on save" for the project:
[project name]-> Properties -> Build -> Compiling.
This removes the project's build subdirectory, whose contents include
build/classes/.netbeans_automatic_build
build/classes/.netbeans_update_resources.
OneDrive sees these files as nameless with long extensions.
You can enable "Compile on save" in working sessions if desired,
just disable it when you want to make it available to other machines.
You may need to ensure the files are available offline. Windows 8.1 and OneDrive use a feature of Windows where files appear to be in a folder but may not actually be there yet (because they are in the cloud). While most applications are able to trigger files to be downloaded when opened, not all applications are compatible.
Try forcing the folder to be available offline by right clicking on the folder and selecting "Make available offline" and see if that resolves the problem.
NetBeans along with a number of other multiplatform applications tend to save configuration files in .settings/.configuration files. And unfortunately as of today the OneDrive client does not support syncing files the begin with a period. The OneDrive team is aware of this limitation and is looking into fixing this.
Not great solution, but a potential work around:
- Stick your NetBeans projects in a zip, 7z, tar or whatever convenient packaging format of your choice would be before you leave that machine.
Ultimately it sounds like your scenario is around using source control. While it is certainly not as easy as just using sync'ed folder, you could use a source control management tool like SVN, Mercurial, or Git.

Installer Wrappers for Executable Jar with Dependencies

I've written a program in Java (executable JAR) and need to create an installer for it. The installer needs to have the following qualities:
Must work in Windows AND Mac environments.
Allows for the usual "Next -> Next -> Install" installer prompts. (Ease of use for customers)
Must allow exact placement of external dependencies.
Note (#3): Many of the external dependencies need to be placed in the same directory as the executable jar for the program to work correctly.
And it would be nice if it was easy to configure. It doesn't have to be free, if it costs a few bucks and is very simple, please include it.
Thanks.
EDIT: Please no "that's stupid, redesign" comments/answers. I didn't choose to make the program with external dependencies, it was specified by my employer for certain reasons. I make it their way or they find someone else who will.
Use IzPack.
It's free, and allows for building installers for Windows and MacOS.
Not sure about the #3 requirement, but it's a installer, so you should be able to just feed it with files, and specify install paths for them.

How do I create an Installer for a Java Application?

This is still awhile down the road for me but for my Project Implementation class we have to create a program and then distribute it. I have written an application in Java and from the specification I have made in the previous class (Project Design) my application will need to be platform-independent.
For mac and linux the user can just run the jar file from the terminal, but for windows I would like to have the Application installed to the path user chooses (default: C:\Program Files(x86)\NameOfApplication), Create a desktop shortcut (if the user wishes to have one), install under the start menu (if the user wants it to) and then also show up in the add\remove programs list.
Is there any easy way to do this?
Is it any harder if I did decided to create an installer for mac and linux?
Thanks in Advance.
You can create an installer with NSIS, even for a Java application.
You might also consider distributing your application via Java Web Start.
There are opensource installer generators for java. I have never used one before. Here is a good resource of links
I recommend using Java Web Start.
It has several advantages.
Available for all major desktop platforms
Single distribution for all JWS-enabled platforms
Code-signing and sandboxing
Versioning and incremental updates
Automatic installation of JREs and optional packages
It has one major disadvantage.
Internet connectivity is required if JWS, JRE, and/or an Optional
Package is not present on the system
Have a look here and here
Install4j does what you want, although you have to pay for it. Personally, I am not aware of any free alternatives. You can make installers for Linux and Mac OS as well.
you can use Exe4J, see http://www.ej-technologies.com/products/exe4j/overview.html
You can do most of that using standard JNLP:
http://docs.oracle.com/javase/1.4.2/docs/guide/jws/developersguide/syntax.html
You make a JNLP file that takes the executable JAR from some local (or remote) location and creates a Desktop icon for it (of your chosing). Only difference is that the actual JAR will be placed in the JDK's jar cache directory (not in a directory of your choice - I don't think the user would care much).
The huge advantage with this is that if you make a JNLP that installs the jar from a remote location, you can remotely upload a new version of the jar to that location, and when the user next accesses the jar locally, your latest version will be downloaded and placed into local cache.
Also I recommend you use a smart "fat JAR" builder, which packages all dependency jars inside the executable jar. Eclipse IDE has a way to export a project in this format (and also adds the necessary class-loader so that all works ok from on fat jar).
If your target OS is windows I highly recommend Advanced Installer. It's very very easy to use and will let you create your own native microsoft installer (.msi) with specific target Java VM and a bunch of useful windows features, even in the free version. Note you can also include a private jre into the package.
http://www.advancedinstaller.com/top-freeware-features.html
If you want a "package one deploy everywhere" solution then IzPack is the way to go, platform independant, free and open source.
http://izpack.org/
Depending on the complexity of your project Java Web Start could be a very good option, it's very simple configure and maintain but it relies on the browser's java plugin and believe me... most users DON'T like being warned about certificates and risks everytime they launch an application.

How to install eclipse for java developer,c/c++ developer, php developer at the same time?

Now I am trying to install eclipse on my computer under Windows 7. The problem is how to install the eclipse for java,c/c++,php,javascript concurrently?
Would donwloading the four zip files and then unziping them all into one directly say d:\eclipse works?
Is there any good tutorials for installation/configuration of eclipse?
The zips are just pre-bundled archives of Eclipse plus the relevant plug-ins. Just pick one, install it, then use Help | Install New Software to add the other plug-ins you want.
You can download all the zip directory and unzip it in the same folder (e.g. ECLIPSE_HOME) and run eclipse. Eclipse will first inspect it 'plugins', 'features` folders and update configurations for future use.
Alternatively, you can download the main eclipse (Simple Eclipse for Java SE) and goto Help --> Install New Software menu and select the C++ packages (and all relevant packages) you need and install.
You could either download eclipse for one of the languages and then download plugins for that one or you could download the four separate zips and unzip them to the same PARENT folder!
Like:
/Eclipse/Java
/Eclipse/C
/Eclipse/Cpp
/Eclipse/Php
I'm not sure what would happen if you'd unzip them to the same folder, but I would dissuade it. By unzipping them to a separate folder you can launch a specific eclipse installation for one of the views, so you won't have to switch views.
Also, I remember that having one eclipse version with multiple plugins tends to make eclipse messy (at least at the time when I was using it, more or less a year ago)

Categories