launch file(.exe) is missing after building rcp application on Jenkins - java

During migration of Eclipse rcp application created using eclipse 3.x (Indigo) to Eclipse 4.5.2 (Mars), there is no issue found while running the application from Eclipse 4.5.2.
Also while building the application on Jenkins using ant file, the installer is created. But after the installation of installer, the launch file (.exe) for launching an application is missing.
Also, there is a *cli.exe (command line executable) is present.
But after running it via command line, the below error comes:
Error: Could not find or load main class org.eclipse.core.launcher.Main
What could be the problem? I cannot add the console output of Jenkins, since it is very big.

Well first check your generated plugins directory, is there a org.eclipse.equinox.launcher bundle? If not do the following:
If you are using a feature build, check your feature.xml if org.eclipse.equinox.launcher is missing or if the wrong version is being used.
If you are using a plug-ins build, check your ApplicationName.product file if org.eclipse.equinox.launcher is missing or if the wrong version is being used.
Check your ant file, if there is a link to the following bundle:
plugins/org.eclipse.equinox.launcher_1.x.x.x.jar (x should be some version)
If so, probably the wrong version is used.

Finally one issue is resolved.. .exe is creating now after installing the installer.
The reason was I was missing some important plugins which should be added by adding delta packs(for multiple platform builds).
for more info about delta packs, refer https://wiki.eclipse.org/A_Brief_Overview_of_Building_at_Eclipse#Cross-platform_build

Related

How to configure Grails for Netbeans?

I am trying to configure Grails in Netbeans.
Grails version:3.2
Netbeans: 8.2
JDK: 1.8
OS: Windows 10
I have install and configured environment path and other stuffs. I can create and run project from the Command Prompt. But I can not create project from netbeans.
Warning |
Unrecognized flag: non-interactive.
Error |
Specify an application name or use --inplace to create an application in the current directory
This error is showing, to create project from Netbeans. I can run the created project though. I have already added Groovy plugin.
How can I solve this problem?
I don't think you are doing anything incorrectly. I have an environment very similar to yours (Grails version: 3.3.2, Netbeans: 8.2, JDK: 8u151, OS: Windows 10) and I see the same error: Specify an application name or use --inplace...
This is a known issue with NetBeans 8.2 that has already been bug reported; see Bug 258407 - Error when creating a Grails 3.1.x project. The problem has been confirmed to exist in Grails releases 3.1.0 up to 3.1.4, but I see the same issue in 3.3.2, and there is no fix for NetBeans 8.2.
However, I successfully created a Groovy/Grails application using JDK 8u151 with a DEV release of NetBeans which you can download from here: http://bits.netbeans.org/download/trunk/nightly/latest/
Note the caveat that comes with using DEV releases of NetBeans:
These builds are still under development and could contain defects
that lead to data loss. They are meant for evaluation of new features.
As always, be sure to back up your changes if you use these builds on
your production code.
As long as you can you can live with that situation, using a DEV release is your (only) solution for creating Grails 3.x applications in NetBeans.
One final point: unlike NetBeans 8.2, DEV releases of NetBeans support Java 9 as well as Java 8, but don't use Java 9 when creating a Groovy/Grails applications. It won't work for a completely unrelated reason.
I'm using Windows 8 and Grails 3.3.8, but the following worked for me:
Create the project using system command line (I used instructions in this page: how to create grails project through windows command promt).
Import the project to Netbeans 8.2 by clicking on File > Open Project... and selecting the project folder.
This solution works for me (Mac OS)
1) Open de console inside Netbeans
2) Navigate to your GRAILS_HOME/bin
3) Type grails create-app [YOUR_NAME_APP] --profile=web (rest-api, etc)
4) The project must be created at GRAILS_HOME/bin/[YOUR_NAME_APP]
5) Do not try to import into Netbeans instead of it Open the project
6) Start coding!
You can move the folder GRAILS_HOME/bin/[YOUR_NAME_APP] to the Netbeans workspace before open the project.
FYI, I am using netbeans 9 and grails 3.3.8 (dont use 3.3.9, its broken), and it works like a dream. I can create domain classes etc. from the menus in netbeans, run, debug etc. THe only thing I had to do was manually install the grails plugin for netbeans, and configure my grails paths etc. The answer on how to set this up is here: how to open a grails 3.3 app in netbeans 9?
The only thing I cant get to work (and its a bit of a show stopper), is multi-module projects (i.e. a grails app which depends on a grails plugin). I can run them, but netbeans does not recognise any of the imports so there is no code completion and it shows all files are having errors. What a shame, as appart from this, netbeans has very good grails support.
Note, I always create projects on the command line, e.g. "grails create-app myapp ...", then simply use the open project menu in netbeans and it instantly recognises them as grails.
Ensure you have gradle plugin installed for netbeans. Then go to File -> Open Project.
You should see the project shown by netbeans as a gradle project.

Setting the JVM to use with Ant when using the command line

I have to build a project using Ant from the command line. It is an EAR to be deployed on weblogic 8.1 and as such the classpath is set on the correct jrockit, shipped with the 8.1 server. However, the tool keeps using the jre7 (also installed on my machine), going as far as not even starting if i uninstall the jre7 and leading to problems such as "Cannot find class Object", and so on.
Before running ant, I run the %WEBLOGIC_HOME%/server/bin/setWLSenv.cmd file in the same console session. Both %WEBLOGIC_HOME% and %JAVA_HOME% are correctly set. The jre7, as far as I know, is not referenced in any environment variable nor in any of the build files. I am not permitted to modify the build.xml file, also I can't use Eclipse or any other GUI to build the project.
So, how can I persuade ant to use the correct JVM?

Running Ant Build.xml getting: Java Virtual Machine Launcher: Could not find the main class. Program will exit

I am writing my code in eclipse, the code is running fine but when I try to build it in ant by running build.xml. I am getting
Java Virtual Machine Launcher: Could not find the main class. Program will exit.
Any suggestions?
if you are using java 1.6 and upgraded eclipse, it's more likely caused by eclipse the solution is to go to Run as → External tools configuration… → JRE where the default was set to “Separate JDK”: jdk1.6.0_31 and change this to “run in the same JRE as the workspace” (1.7/1.8), and it should works.
Bug fix would be to provide a working default configuration with setup. Configuration should be in a way it does not break if the user adds additional JDKs to Preferences.
for more details you can see Bug 472599
You need to verify few things
1) Is the path to java bin directory set properly?? (To check this you need to write command javac in command prompt(cmd) and you will get a list of instructions on cmd console) 2) Open the eclipse and go to Window-> Preferences-> Ant-> Runtime in the Classpath tab, see Ant Home Entries pointing to the wrong directory (it still points to the last directory, this directory does not exist) you have to do is to change the Ant Home pointing to the correct directory, to point Ant Home button select Ant Home directory, for example, I use Eclipse 3.3.1, Ant Home is the Eclipse plugin directory org.apache.ant_1. 7.0.v200706080842.
Right click on the build.xml file and select Run As --> External tool configurations --> Jre --> Select Run in the same JRE as the workspace.
If you are using Java 1.5 (that is, it is specified in your workspace, project or ant configuration as the JVM to use), it is also caused by a bug/feature in Eclipse: Java 1.5 is no longer supported. You need to upgrade to Java 1.6.
See: Eclipse bugs 421423
The version of ant you're using may not be compatible with the version of java you are using. I have ant 1.9.4 and was trying to run with java 1.4 and got this same error. Running with java 1.7 fixed it for me!
Error I was facing :
"Could not find the main class :
org.eclipse.ant.internal.launching.remote.internalAntRunner. Program will exit."
To compile my code with JDK 1.8, i have added external ANT to my eclipse, which was working fine. But compiling the code with JDK 1.6 with same ANT version was not working.
Solution : I restored the ANT in to its default value by selecting " Restore Default Entries " ( ANT --> Run as --> External Tools configurations --> classpath" ), after that ANT with JDK 1.6 is working fine.
Above error was happening for me when i added external ANT to my eclipse which was compatible with JDK 1.8 usage. Ant was working with JDK 1.8, the same was not working with 1.6 JDK. Once i restored ANT classpath settings to its default eclipse values which was JDK 1.6 compatable, above error was gone.

Executing Eclipse plugin (jdt/ast) outside eclipse IDE environment

Can I execute Eclipse Java development tools as a standalone process? I need to get Java program's AST structure using Eclipse JDT from another program, and to do that, I need to execute eclipse plugin as a stand-alone process behind the scene.
Is that possible? If so, how one can do that?
Eclipse/jdt and eclipse/ast is nothing more than a jar file, so one can use them to build standalone java application.
Example
I googled to find ASTExplorer as an example to make eclipse/ast plugin as a standalone java project.
The program was targeted for pretty old eclipse (3.0.2), I downloaded the 3.0.2 for Mac OS X this site - http://archive.eclipse.org/eclipse/downloads/drops/R-3.0.2-200503110845/
You need to setup ECLIPSE_HOME classpath variables in Preference -> Java -> Classpath variables
The .classpath has those classpath variables already, you can refer to this post - .classpath contents update in eclipse. As you can see it refers eclipse/jdt(art) jar files. I'm pretty sure one can change the reference to the newest version of jdt/ast without downloading the 3.0.2 version.
As I use Mac, I need to replace the swt for PC with swt for Mac. I could do that in BuildPath/Configure Build path
First remove the PC swt reference.
Then add the correct Mac swt reference.
Compile the example with the eclipse indigo/on mac
When the setup is correct, eclipse starts building the project. You can use Project -> Build Project menu. Then, you can check the application works fine in eclipse.
Generate the executable jar
Export to executable jar file.
You'll get some warnings, but you'll have a jar file.
Execute the generated jar
Just executing java -jar ast.jar doesn't work on Mac, I got a hint from this post.
Running SWT based, cross-platform jar properly on a Mac
In short, you need to run java -XstartOnFirstThread -jar ast.jar
Does it have to be Eclipses's AST? Or is any AST generation o.k.? If it doesn't have to be eclipse, I'd suggest Habelitz open source Java AST Compiler. http://www.habelitz.com/ I'm using it myself for some projects....
Well, of course you can launch eclipse just like any other process : How to create a process in Java
And then the problem becomes relaying the information back to the original process, which gets kind of messy. My suggested approach in this case would probably be to create a plugin in eclipse and have that plugin do whatever it is you think you need the AST for. You can work out messages with command line options to eclipse, or a shared file or something.

Eclipse, java and dotCMS logging issue

I've been assigned the task of tracking down why a webpage is breaking under dotCMS. The page shows an error stack trace with a description that suggests it relates to SQL. I got access to the remote file system and was able to pull up the java file. The sql it is generating is failing when passed to a getResults method. I was wanting to see the value of that string of sql.
Maybe I could create a text file with that value through java. The previous programmer (that left the business) told me that I would need to shut down the server, clean plugins, deploy plugins and re-start the server so the source could be recompiled into jar files. I don't know how to do any of that at this point...and I wonder if those measures should only be taken when I'm deploying the fix.
I know Eclipse has logging abilities because I've dabbled with Android. I didn't know if there is a way that I could somehow remotely connect to the file. I found a tutorial for setting up eclipse with dotcms. It however wants me to check out the official dotcms source to my machine. I guess I don't understand how remote connections work with eclipse and if eclipse could even help with this issue. Noob question for sure!
When you want to run dotCMS from within eclipse it is not that hard. Remember that dotCMS is just tomcat with a default host deployed in it (the dotCMS application). You can download the dotCMS source here: http://dotcms.com/downloads/index.dot. Startup eclipse and add a tomcat server ( It is tomcat 6.0.26 at this moment), pointing the tomcat folder to the tomcat directory in the dotCMS install folder. You can start tomcat from eclipse this way.
You will have to deploy the plugins if you need to debug those. Below I describe it in detail, but dotCMS has a page on this on their official site as well: http://dotcms.com/plugins/plugin-faq.dot#HowInstall
Make sure you have access to the server that dotCMS is deployed on. On windows that would mean a remote desktop, and on linux you'll need ssh. If you have it running in eclipse on your local system then of course you're set already.
After logging in on the server make sure you have apache ant installed on your system. You can check if you have it by typing "ant -version" on the command line (in a dos box on windows). If you have it installed you'll see something like this:
Apache Ant version 1.8.0 compiled on March 11 2010
if you don't have it installed you can download it here: http://ant.apache.org/bindownload.cgi
install ant and make sure you put the /bin folder on the PATH, so you will be able to call ant from all directories
Now check if you have a JAVA jdk installed. You will need a jdk and not only a jre, because building the plugins includes compiling java files into classes. You can check if you have the jdk installed by typing "javac" on the command line. If you don't have it, install the latest java jdk from here : http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u3-download-1501626.html
install the jdk and make sure the /bin folder os on the PATH
Now stop dotCMS
Go to the root of the dotCMS folder and undeploy the plugins using this command:
ant undeploy-plugins
Now build the plugins
ant build-plugins.
And finally deploy them
ant deploy-plugins
Your plugins are redeployed now. You can restart dotCMS.

Categories

Resources