According to this oracle docs there is a conventional java app packaging along with runtime JRE. (Self-Contained Application Packaging)
I know that there is this thing (Launch4j gradle plugin) but I'd prefer to have a bat/sh executables along in the package.
Going through gradle docs and googling I can not seem to find is there is a way to teach gradle to package desktop app with JRE. Is there?
Have you tried this plugin yet?
https://github.com/FibreFoX/javafx-gradle-plugin
This has been a while ago, but if you're still looking for packaging Java desktop apps, have you tried Hydraulic Software's Conveyor?
https://conveyor.hydraulic.dev/
It's a commercial app, but it's free to use for Open Source projects.
Related
I recently downloaded VS Code for Java development. When I initially opened an existing Java Project in VS Code, it was unable to identify objects from the Selenium library. I downloaded the Java Extensions plugin and a few others, and now VS code will not recognize any of my imports as valid. Javax and Java.swing are among the now undetectable libraries. Is there a setting I missed? What do you recommend?
VSCode just an Editor, after you install some extensions, it only makes the editor more convenient, get more abilities even can help you develop the project of some kind of language through combine with the language support in your computer. Such as, you need to install JDK, then to install the 'Java' extension, then the extension to combine with the JDK and the VSCode, then you will get the ability to develop java project in VSCode.
That's means, The 'Language Support for Java(TM) by Red Hat' has nothing to do with java development. For example, after you install the JDK on your computer, you can develop java projects in the other IDEAs such as Intellij IDEA or some others. The 'Language Support for Java(TM) by Red Hat' extension just to combine the JDK with VSCode better, to make VSCode better to develop java project.
As you said, you failed to import libraries. Of course, the 'Java' extension without any libraries of java. You need to configure it by yourself. In the Explorer panel, you can find 'JAVA PROJECTS'. In it, you can find which libraries you have referenced and you can adds libraries in it. And of course, you'd better take maven to manage your project.
By the way, recommend you to install 'Java Extension Pack' extension.
You're going to need to add support through extensions because by default VS Code does not support Java. The great thing about this extension is that you get a slue of other extensions as well, such as; maven, debugging tools, support for junit, auto completion, etcetera.
On a side note, you could always use an IDE/IDEA like IntelliJ, Eclipse, or likewise. I'm definitely partial to IntelliJ but they all have their pro's and con's.
I wanna export my app to PC and Android devices. If i create a JavaFX project with sdk 13.0 and try to export as a JavaFX application it says fx:deploy not supported. So i tried gluon plugin. But when i open a project i cant run even the empty scene. I found one tutorial on the internet how to do that, but he had inside the build.grandle some long settings, and i have only one line
apply plugin: 'base'
And i get this error every time
The project uses Gradle 4.3.1 which is incompatible with Java 10 or newer.
What is the easiest way to export java app to exe or apk ?
Creating an installer for the desktop platforms (Windows, macOS, Linux) has become easy these days. The tool of choice is jpackage which started to be shipped with JDK 14. It can either be used on the command line on the finished project or you can use a Gradle plugin (https://github.com/beryx/badass-jlink-plugin). If your project is not modularized you could follow this tutorial https://github.com/dlemmermann/JPackageScriptFX which also uses jpackage but together with Maven and some other tools from the JDK. The Maven part could easily be rewritten to Gradle, if needed.
Building for Android or iOS is another story. You will need the Gluon client-gradle-plugin (https://github.com/gluonhq/client-gradle-plugin) to do that. But I think it is rather naive to believe that an application which is written for the desktop can be used one to one on a mobile platform. Technically this would work for a hello-world like demo but not for a real application just because your environment, the form-factor and many other things are just different. So you will have to adjust your project to accommodate for that.
I downloaded the project folder from :
https://android.googlesource.com/platform/packages/apps/Gallery2/
For some reason, when I opened it into my Eclipse environment, it is not compiling and it shows a lot of broken references. I am attaching screenshot for your reference:
Any ideas if I am doing something wrong or the code itself has issues?
This is a platform package, not a stand alone 3rd party package. It uses classes which are part of the platform, but not the Android SDK. It's built with the platform as a whole using make rather than Eclipse and ultimately is in the ROM (i.e. flash image.) You won't be able to build it with Eclipse and try to deploy it.
Many of Android's core apps depend on internal system APIs that are not available in the standard SDK that developers compile against. You can find some more information from this question.
There are different version of eclipse for different development environment.
My question is IF IDE remains same then why different versions, and if someone want to use all supported environments in single IDE how he/she can achieve that.
I want to use eclipse as single IDE for PHP, Java & Reports and Android development, instead of using different installation of eclipse.
Somebody helps me or refer me some link, it's quite confusing!
All the versions of Eclipse on the main site download page are the same version of Eclipse, but packaged with different sets of plugins. You can always install more features in Eclipse by installing more plugins.
You can have a single installation of Eclipse and use it for all your development needs - depending on your tastes however, it may sometimes be more manageable to have separate installations of Eclipse for different tasks (when there are a lot of plugins, Eclipse can take noticeably more time to start.)
There ARE different versions of Eclipse out there. But if we stick to one version and look at why there are different variants to download it's basically just that they come prepackaged with a specific component. So if you would like to use your Eclipse for C++ development you can get going with on single download. Instead of downloading the main IDE and then adding the module to support C++.
But after you install Eclipse, with any prepackaged modules, it's easy to add new ones. Say you have Zend Studio which is a PHP IDE based on Eclipse. You can still add all other modules supported by the version of Eclipse that Zend Studio is based on. For instance the Android SDK kit for Android development. You can add most modules by doing a search for them and finding the url to it's update site. Then click Help->Install New Software. Then you click Add and add the URL of the Update site of the module you wish to install.
Then you can select it from the Work with drop-down and it should appear in the list. Select it and click Next.
That way you can install almost all available modules for Eclipse. Note that sometimes you can run in to compatibility issues between installed modules and dependency problems. But most of the time it works fine.
They are not different versions, just the same backend with plugins for the particular language. Just that the specific versions are configured for best use with the language specified. If you want to use more languages than the default one in the eclipse you downloaded, just download the plugins you require and install in your installation of eclipse
Eclipse is plugin based IDE and these plugins may not like each other sometimes. It will be better to use more installations. In fact if you are developing Java and PHP you will need only 2 of them.
STS is a good Java toolkit especially if you work with spring.
If you new to Eclipse you should know that it can go crazy couple of times per month if you install too much and it is very annoying to see that one day your webapp is deploying and second day no...
Keeping installation separated you will have better control.
I am just getting started with Grails. How do I add Java libraries to my Grails project? I added the Smack library jar to the lib folder of my Grails project, but I still cannot import any of its packages into my Java or Groovy classes. I am using the Netbeans IDE. Any help would be appreciated..
Buzzy
This is a know bug in NetBeans: http://www.netbeans.org/issues/show_bug.cgi?id=144243
Maybe you can help the devolpers to fix it by adding a comment to this issue in the NetBeans bug tracker.
Here is what I did to solve the problem when running SpringSource Toolsuite:
Configure the build path by adding external jars (e.g. javax.mail, adwords-api, etc.)
Imported the same jars in to the lib folder (where mysql connector jar is located).
This should fix the compile time errors you would receive from missing imports in your java files.
Hope this helps
As stated above, this is a bug in the IDE, not Grails. Those libraries are available in your code, but the IDE won't do any code completion, etc.
Note, NetBeans 6.5 is supposed to have much better Grails integration. Or, you could use IntelliJ, which already has it.
G2One's acquisition by Spring Source makes the roadmap for Eclipse integration for Grails look much rosier, too. It's not there yet, but it's coming, and now maybe faster than we thought.
The issue still remains in NetBeans 6.5 (Build 200811100001), so the IDE will not do any code completion and formats the code that is referencing classes in the JAR as erroneous.
I have not tried NetBeans 6.7.
I'm using Netbeans 6.7.
I just pasted the library in the project's 'lib' folder and when I went back to Netbeans the library was under the 'Libraries' folder automagically!
i m also using netbean 6.7 and it's automagically working when i passed the jar under Libraries folder