Change of environment

Asked

Viewed 92 times

3

I’m moving from environment, from VB.NET to Java (Netbeans), but I’m still not sure if some of the possibilities of . NET can be performed in Java with Netbeans.

My first doubt materializes in the possibility of compiling a project a .dll and refer it to another project for its consumption. Such functionality can be performed in the Java environment?

My other question is how projects are published, in . net the default output is . exe installer with auto-update, there is some way to do the same or something similar in netbeans java environment ?

I want to emphasize that it is my goal to use multiple platforms, more specifically Windows 7+ or Linux Ubuntu (latest version), avoiding if possible, some path that leads to a software version for each specific platform.

  • Hello, welcome to [en.so]! Is there any particular reason you chose Java? Do you need to be Java? Are you migrating existing systems to Java or are you starting to develop new systems in Java? Does the new system need to be desktop or web? Will it be used on the Internet or an intranet? What is the expected update frequency?

  • Thank you, there are two main reasons that motivated the choice, first is that the low cost with environment, which as far as I know is free, and the second is the ability to run these systems in both windows and linux. The focus of this migration is only with desktop systems, which will have access to the internet, the system already exists in the Vb.net language and I intend to rewrite it completely.

1 answer

5


TL;DR

In general, Java and . NET have many points in common and can achieve the same goals although with greater or lesser difficulties in different areas.

Let’s go in pieces...

Cost

Are licenses really a deterrent? The most expensive resource is almost always human. It is common for companies to try to avoid spending on licenses and then have to hire more people to do what the tool could have done, only to spend a few more months.

On the other hand, Microsoft has created some developer-friendly licenses, startups and small businesses often free. I suggest you consult if you really could not use such tools.

In general, a good Java environment can be all free and many serious companies use only open and free tools, but make this decision based onif only the cost of licenses is not a good idea and in general it takes experienced people spending a good time thinking to make this decision in the right way.

Consider also the cost of learning a new platform. There is a reason why Java programmers are usually hired for Java vacancies and respectively for other platforms. It does not mean that we can not learn, but until there several basic mistakes will have been made and productivity will be low.

Ides

Java has good free Ides. The best known and used ones are:

  • Eclipse, the most used IDE with the largest community
  • Netbeans, which is nowhere near synonymous but is maintained by Oracle and, in my opinion, contains the functions most relevant to the world corporate, therefore more like Visual Studio in certain aspects.

On the other hand, there are paid Ides for Java as well, such as the Intellij IDEA, which in my opinion is better than the others in various respects, although this does not mean that others do not have their advantages.

But, no matter how great the Ides are in Java, they won’t be better at all than Visual Studio. One of the reasons this happens is that in Java there are many different ways of doing things and Ides will only support a few more used.

In general Visual Studio and other Microsoft tools will have many more chewed up functions, while in Java you will have to search for some framework or library that does the same thing.

As for Netbeans, you’ll see below that it seems to support what you need, but how does that compare to what you have in Visual Studio only an expert in both technologies can say.

One advantage of Java Ides, especially Eclipse, is that there is a wide variety of plugins for various purposes. Although you have deal with a myriad of different suppliers, at least you have more change of finding what you need, perhaps with more than one alternative.

Desktop applications

Java has different ways of making graphical interface. The most used technology for cross-platform applications is called Swing. However, the most current technology is called Javafx.

Many companies successfully use these technologies to create graphical interfaces for cross-platform desktop applications.

In Java in general I don’t recommend you count 100% with a visual "click-and-drag" editor that does everything for you. The approach of building the graphical interface via code is almost predominant in Java applications.

Netbeans supports both development with Swing as with Javafx, but each has a different level of support from the IDE.

Installation and upgrade

The point here is how to distribute your application.

Installer

Netbeans itself is built in Java and has an installer. Several other tools do the same.

For Windows, you can do this manually by packaging your system and using a free installation tool such as the NSIS.

The Netbeans IDE also features a way to create a native installer.

There are also other tools, some free and some paid, to create these installers.

Java Web Start

If I were in your shoes, I would consider putting aside the "old" approach to distribution and, if possible, adopting a more modern technology.

If a web system is not possible, you can still use the technology Java Web Start. This consists of making your application available on a web link.

Basically you provide a URL to your customers. When a client accesses this URL (having Java installed correctly), your application will be automatically downloaded and started. New versions will be automatically downloaded.

Cross-platform

A system in Java has all the potential to work in any environment supported by the virtual machine, but obviously there are some points to be careful.

If you know both environments it is more obvious, but it is always good to maintain a testing process that encompasses both environments.

Some of the common problems involve:

  • Use native visual components of the operating system (AWT).
  • Expect certain sources to be available.
  • Waiting for certain directories to be available (/tmp or c:\temp).
  • Visual components may differ between different systems, so do not rely on the exact amount of pixels of each component.
  • Directly concatenate bars into paths (e. g.: base + "/" + subdir).
  • Do not specify at all times the encoding, because Java will use the encoding of the operating system that is different for each system
  • Failure to maintain a standard in the treatment of line breaks

In general, Java applications do not need directives or conditionals to run on different platforms, unless you need to run external tools.

Componentization

As a general rule, Java does not generate Dlls or executable itself.

Java classes are compiled for bytecode in the archives .class. Such compiled classes are usually grouped into files .jar.

You can create as many projects as you want and generate a Jar from each one. The final application would be a composition of a set of these files .jar.

Remember that managing multiple projects or libraries and their versions can be a complex task. In Java, we usually use a tool for this, the most common being called Maven. You can read a little more about Maven in my article:

Installing, configuring and using Maven to manage your dependencies and your Java projects

  • I get it, I really appreciate your more than complete explanation on the subject and I assure you I’ll think about my decision better thanks to this. Thank you very much

  • Excellent explanation !!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.