set vmparameters in install4j based on condition - install4j

I need to set -classpath based on java version used to start the application.
In install4j -> Launchers -> Java Invocation -> VM Parameters, there is no option to specify condition. But I need to change value for the -classpath VM Parameter based on java version.
Is there any way to do so in Install4j.

In the launcher wizard, on the "Java invocation" step, click the "Configure Version-Specific VM Parameters" button.

Related

Eclipse RCP: How to set launch parameters?

You need to set the path to the directory "splash_v1" in plugin "com.project.console". Example without directory "splash_v1":
osgi.splashPath=platform:/base/plugins/com.project.console
If you are asking how to define launch parameters when starting up your RCP application you have two options.
Define them in the Run Configuration (configurable via Project > Run Configurations)
Define them at startup by passing them in with the executable from the console (e.g., ./myrcp -application myrcp).
For an overview of runtime options, cf. The Eclipse runtime options.

Remote debug JBoss AS 7.1 from Eclipse Indigo

I read some guides on the subject and made the following steps.
http://oreilly.com/pub/a/java/archive/eclipse-jboss-remote-debug.html?page=8
https://community.jboss.org/thread/177687
JBoss debugging in Eclipse
The guides have some distinctions but on the whole they are similar.
The steps I made.
I compiled and deployed my web project and deployed it on JBoss AS
7.1 by clicking Run on Server -> JBoss AS 7.1 in Eclipse.
I stopped JBoss AS in Eclipse.
I uncommented the line
JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
in the $JBOSS_HOME/bin/standalone.conf file
I executed $JBOSS_HOME/bin/standalone.sh
I updated the page localhost:8080/MyProject/ in the browser and it
worked
I executed Debug -> Debug Configurations in Eclipse, then I created
a new configuration with the localhost as the host, 8787 as the
port, and MyProject as the project name.
I pressed the Debug button in Eclipse.
When I reach a breakpoint I added, nothing happens.
I expected that Eclipse would stop at the breakpoint as it does in a simple Java application project. What did I do wrong?
Eclipse version: Indigo.
Java.
java version "1.6.0_43"
Java(TM) SE Runtime Environment (build 1.6.0_43-b01)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01, mixed mode)
Edit #1.
Window -> Preferences -> Java -> Installed JRE's
Edit JRE being used
Edit 'Default VM Arguments' line
-XX:+UseParallelGC
It didn't help.
Instead of making the changes in "standalone.conf", make the change in "standalone.conf.bat" .
Remove the rem from the line "rem set "JAVA_OPTS=%JAVA_OPTS% -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"" .
This has worked for me.
You will need to start JBoss with a few extra options to the JVM. You can set these either in standalone.xml, or via the JAVA_OPTS environment variable. The options look basically the same, but for this post I will use JAVA_OPTS. Read this post from the JBoss Community forum if you want to use standalone.xml to configure the JVM parameters.
Add this line to your existing JAVA_OPTS:
-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n
The port number (8787) above must match your Eclipse setup (see below).
Finally, you will need to tell Eclipse how to connect to the remote process. In Eclipse, click the Debug button’s drop-down arrow and select “Debug Configurations”.
In that dialog, navigate to “Remote Java Application” and click the “New” button.
Under “Project” select the project that contains the code you want to debug.
Under Connection Type make sure “Standard (Socket Attach)” is selected.
Under Connection Properties, make sure the host (e.g., localhost) and port (which must match the port spec in the JAVA_OPTS, in this case 8787) are set.
Click on the “Source” tab and add any projects containing code you want to debug (if there are other projects in your workspace that contain code other than the main project).
In the Common tab, under “Display in favorites menu” select the Debug icon and a handy dandy icon will appear in your Debug toolbar dropdown (the name will be the same as the Project setting from earlier).
If JBoss is already running (with the options set earlier) click Debug to attach. If not, start JBoss, then click Debug to attach.
Now you can set breakpoints, step through your code, etc.
Have fun!

How do i configure eclipse to make use of different version of JDK

I have three project running on eclipse i want to use JDK 1.4 for two project and JDK 1.6 for third project how do i do that?
You need:
first to declare the different JRE in your Eclipse: See "Eclipse - no Java (JRE) / (JDK) … no virtual machine…"
then to add the right JRE in your project settings (see this blog post for instance)
The default JRE is shown with a check mark and is used by new eclipse projects unless the project specifically overrides the value.
So the next step is to check which JRE the current project is using.
Right click the project and choose "properties".
Select "Java Build Path" and then click the tab labeled "Libraries". You should see an entry like "JRE System Library [version]".
To change the JRE version,
highlight the entry and click "Remove".
Then click "Add Library...". Choose "JRE System Library".
If you choose "Workspace Default", the project will use the JRe defined under "Windows -> Properties" as explained above.
You may also specify an alternate JRE located somewhere on your file system, or choose an embedded execution environment provided by Eclipse.
you can configure VM in eclipse.ini file.

Eclipse on Mac, getting "Specified VM install not found" error when trying to build

When I try and do an Ant build on my mac (Snow Leopard, Eclipse 3.6 - Helios) I get an error dialog that says
"Problem Occured"
'Launching projectName build.xml' has encountered
a problem. Specified VM install not
found: type Standard VM, name jdk1.5.0_14
I can't even find any preferences setting in Eclipse that specifies for it to use jdk1.5.0_14.
When I went into my preferences and went to the Java section and looked at the Installed JREs, the only one I have specified is 1.6.0. Where is it getting the setting to try and use 1.5? (Or am I barking up the wrong tree?)
Your ant project launcher refers for some reason to a Java 5 environment.
Select "Run as -> Configurations" and locate the ant build. Then indicate you want this configuration to run with a Java 6 JVM.
Delete the
".metadata.plugins\org.eclipse.debug.core.launches\ build.xml.launch" file and problem is solved".
This is just an update of the previously posted solution for later versions of Eclipse, like STS.
If your Ant View is open, R-click on the root (otherwise Run -> External Tools -> External Tools Configuraitons)
Run as -> External Tools Configurations ...
Your Ant launch should be selected in the External Tools launchers, if not selected manually
Go to the JRE tab
Select Run in the same JRE as the workspace - you can also select a different JRE using the buttons on the right.
Re-run your ant task(s) - this time you will not get the error message.
There was a whole bunch of stuff I had wrong that I changed to fix this, but I believe the crucial piece was an %ATG_HOME%/home/localconfig/dasENV.sh file had an ATGJRE a path that was incorrect.
I kept getting "Specified VM install not found: type MacOS X VM, name Java SE 6...".
And i did this accidentally and it worked: Properties-Java Compiler-Installed JREs-Search Button.
It did some soul searching,created yet another JRE entry and it all worked!
Right click on the project and choose properties.
Go to Java Compiler and make sure Compiler compliance level is set to 1.6 rather than 1.5.
I think that should do the trick.

how to restrict jdk api version in eclipse

I am using jdk1.6 in my eclipse build path. But i want to restrict the eclipse to show only those methods that is supported in jdk1.4.2. Is there anyway to do this.
Thanks.
Project properties -> Java build path -> Libraries tab.
Select your JDK/JRE, click Edit
Select "Execution environment", Select J2SE-1.4, click Finish, click OK
You might also want to set your JDK compliance level to 1.4, that's in Java Compiler in either project or workspace settings.