Incorrect VM arguments in Tibco6.x Designer - eclipse

I created a tibco 6.3 BW application using tibco designer on Windows.Application is running fine but whenever I try to add Vm arguments (under Arguments tab) in Run Configurations Menu they gets modified after I close the menu. I was trying to add debug arguments
-agentlib:jdwp=transport=dt_socket,server=y,address=9090,suspend=n
for debugging the application but they always gets modified so that some '=' sign changes into space. So whenever I edit vm args and try to run the application I get invalid arguments error.
I think the problem is similar to this https://superuser.com/questions/392230/incorrect-vm-arguments-in-myeclipse-run-configuration
Any help would be appreciated.

Although I don't know why it was happening, but I found a workaround by supplying vm arguments directly to jre, by going to preferences --> java --> Installed JREs --> Edit JRE --> Default Vm Arguments.

Related

Provision of relative VM arguments to JavaFX run configs in eclipse

A little background:
I want to learn JavaFX, I use eclipse ad my IDE, and I usually work on 2 PCs though a pen drive. I have added JavaFX libraries to the JavaFX project, but when I run the program, it is unable to run as VM arguments arent passed in.
The Problem:
I inserted the following VM arguments in the run configuration: --module-path "G:\<Path to lib folder>\Prerequisites\JavaFX\lib" --add-modules javafx.controls,javafx.fxml
It all runs well and fine, but when I try to run the same thing on the other PC, I need to change the args to --module-path "E:\<Path to lib folder>\Prerequisites\JavaFX\lib" --add-modules javafx.controls,javafx.fxml. my the lib folder is present in my workspace itself. So is there any way to make it relative and not change it every time?
Any help will be greatly appreciated! Thank you in advance.
There are many Variables you can use in the VM arguments (and elsewhere). Click the 'Variables' button at the bottom right of the VM arguments field to see the list.
You probably want
${workspace_loc:/project/path in project}

Hide Console log on Eclipse based RCP Application

I have a eclipse based RCP application.While running it as a separate process we are getting console log which contains errors infos and exceptions.Is there any way to hide/avoid the console log by setting any configuration parameter in the config.ini file?
Run the application without the program argument -consoleLog (cf. Eclipse Help). This is usually set in the run configuration or product configuration.
Only by passing this argument should you get a console log at all. Note, however, that even if you don't specify this in your .product file, users may be able to "call" a console log by simply passing -consoleLog as an argument when running your application from the command line.
Also, I'm not sure whether third-party plugins or features would be able to activate the console log.

Adding Environment Variables to Eclipse shortcut

Is it possible to set an environment variable for the current run of Eclipse ( RAD )?
Here is my situation
I have RAD 8.5 and RAD 9.0 installed on my box. It stopped working all of a sudden last week. It wouldn't even come up. When I checked the logs, both the versions had below error in the logs
java.lang.NoClassDefFoundError: com.mercury.ftjadin.hooks.interfaces.WToolkitHookQTJA
After some research I also found out that it is caused by HP's product that was installed on my box ( It was done as a corporate push and I wasn't even aware of it ).
Further research also revealed that there are about 4 environment variables that have a conflict with Eclipse and should be removed / blanked out for RAD to work. This will of course cause the HP product to not work.
So, I was wondering if there is a way to set these to blank in eclipse.ini file for each of the RADs or as part of the shorcut of RAD which is
C:\Software\RAD90\eclipse.exe -product com.ibm.rational.rad.product.v9.ide -showlocation -nosplash -clean
but not blank them out in the Environment Variables definition
This way, I will be able to use both the products without having to save the variable values between RAD and HP Mercury product usages and do not have to do a copy / paste every time which is prone to user errors / mistakes.
Hope the question makes sense. Please let me know, if I need to clarify anything.
You can start eclipse (for example RAD) from eclipse (for example a minimal Java plugin development) and in that case, you have the option to set the environment variables you want to use.
You have to set the target environment to the RAD instance and create a run configuration with the proper environment.
I know, this is less than ideal, but should work.
Another option would be the unsetting env variables (locally) in a batch file:
set var=
Though I do not know whether it would work or not.
This page helped my situation
Instead of playing with registry I took an option of batch
These suggestions will allow to work around this situation even with the environment variables in place and with corresponding values. Note: Conflicting application will not be recognized in a java context because it is being excluded from the java support mechanism.
Impact: Excludes Add-ins support from hooking to conflicting application executable via Windows Registry Editor
Requirement: The application must be started by an EXE file, except Java.exe/Javaw.exe/jpnlauncher.exe
Instructions:
a. Locate the executable filename of the application conflicting with add-in(s) support. Either use the Task Manager or the Microsoft Process Explorer.
b. Open Windows Registry Editor.
c. Navigate to: HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\JavaAgent\Modules
For 32bits applications on Windows x64:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercury Interactive\JavaAgent\Modules
d. Create a DWORD value with the name of the conflicting software executable filenmae and set the value to 0.
Impact: Does not load Java Support for specific launched session
Requirement: Application be launched using a batch file
Instructions:
a. Create a batch file (.bat)
b. Copy/Paste below coding before executing launching of Java application.
#ECHO off
Set _JAVA_OPTIONS=
Set JAVA_TOOL_OPTIONS=
Set IBM_JAVA_OPTIONS=
This approach will disable the java environment variables for the run session of the .bat file. Once batch execution closes, environment variables changes are lost.

Passing proxy settings to a bundled JRE install4j application?

We provided an application installed with install4j, with bundled JRE, to one of our customers. This customer needs some proxy settings configured manually for this application.
I tried to put deployment.config file in the JRE's lib directory but it didn't seem to change anything. I couldn't find a relevant vmoptions either.
Is there a way to pass these settings to the app/jre?
Is there also a way to instruct the JRE to open the Java console when it runs?
Thanks!
/Shmulik.
You can configure the proxy by setting the VM parameters
proxySet=true
proxyHost=...
proxyPort=...
and for authentication
proxyAuth=true
proxyAuthUser=...
proxyAuthPassword=...
You can set them either in a "Run script" in the startup node of the installer action by calling System.setProperty() for the properties or by passing them on the command line like this:
-DproxySet=true -DproxyHost=... etc
As for your second question (better to ask a separate question on stackoverflow)
Is there also a way to instruct the JRE to open the Java console when it runs?
I assume you mean a terminal window, which can be done by selecting the "Windows console executable" property of the installer. You cannot change this property on the command line because this sets a static flag in the binary format of the Windows executable furing compilation.
I created an installer for WINDOWS as well as for MAC. The
application is using an embedded JRE. While the application runs, it's not
able to detect the proxy settings of the network even the option in
the browser is set to be "Auto Detect". But when the proxy settings provided explicitly in the browser, it's able to detect the proxy settings.
Even the proxy settings are not detected when "LAN Settings->Use automatic configuration script" option is selected and points to the .pac file.
Any suggestion, how to provide the proxy settings with BUNDLED JRE and java program can detect those settings without make any further changes in each machine.

How to run build using graphics drivers by using optirun (Bumblebee) from IDE (Netbeans, Eclipse)?

Does anyone know how to make eclipse or netbeans use the graphics card in optimus laptops by invoking optirun (bumblebee) inside the IDE so that one can just use the run button in the IDE to run the program in a graphics card within the IDE.
In simplest form I just want the IDE to do the equivalent of optirun ./javaproject
The way I did this in Eclipse was to first start the Java debugger jdwp and listen to a port. Then start the JVM with optirun java ... and use jdwp to connect to this port. Both tasks can be started at the same time in Eclipse by creating a Launch Group in the debug configuration settings (Run -> Debug Configurations). In detail:
Create a Remote Java Application debug configuration with "Standard (Socket Listen)" Connection Type and some arbitrary port, e.g. 56789. This attaches the Java debugger jdwp on port 56789 to a virtual machine which accepts debug connections at this port.
Now we need to start a JVM with optirun. This can be done with a External Tool Configuration (Run -> External Tools -> External Tool Configurations). Create a new Program configuration in the left side of the External Tools Configurations window. You could directly start optirun java <additional arguments> by filling in the required fields. However, I have decided to use a shell script which is reusable by different projects (As can be seen below, there is one part missing to make it entirely reusable. I'm glad for any help from more experienced Eclipse users...). Hence, the Location field points to this shell script. The script itself accepts three arguments: the classpath for the project, the name of the Java executable, and the port number. These arguments can be passed to the script in the Arguments field of the Main tab, e.g.
${project_classpath:${selected_resource_name}}
ExecName
56789
The shell script looks like this, assuming optirun is in your PATH:
#!/bin/sh
CLASS_PATH=${1}
JAVA_EXECUTABLE=${2}
PORT=${3}
# TODO: fix this java library path: pass it as an argument as well. Is there an Eclipse variable which stores this?
JAVA_LIBRARY_PATH=/usr/local/share/OpenCV/java
#------------------------------------------------------------------------------
optirun ${JAVA_BIN} -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:${PORT} -Djava.library.path=${JAVA_LIBRARY_PATH} -Dfile.encoding=UTF-8 -classpath ${CLASS_PATH} ${JAVA_EXECUTABLE}
#------------------------------------------------------------------------------
Finally, the two pieces are brought together in a Launch Group in the Debug Configurations window (Run -> Debug Configurations). Create a new Launch Group and add the two previously generated Debug configurations by clicking on Add in the Launches tab and by selecting the appropriate configurations.
Note that due to the classpath variable in step 2 (i.e. ${project_classpath:${selected_resource_name}}), the appropriate package needs to be selected in the Package Explorer before clicking on the run debug configuration button (make sure that the Launch Group is selected).
This solution works perfectly for me: I can debug Java code inside Eclipse which calls native code involving CUDA optimizations and Bumblebee only activates the discrete graphics card when necessary.
Just use optirun to start the IDE. For example, optirun eclipse or optirun netbeans
I build the project in Netbeans (F11) and run the following in a terminal:
optirun java -jar path/to/javaproject/dist/javaproject.jar
Mind that if you have any java parameters in your project, you need to add it manually. My workflow is like this:
Locate the Java options from the project, open Project -> Properties, Run. At VM Options I see -Djava.library.path=lwjgl/native/windows;:lwjgl/native/linux. I also have some parameters that I want to pass to main(String[]). With this information, I open a terminal and run:
cd path/to/javaproject
optirun java -Djava.library.path=lwjgl/native/windows;:lwjgl/native/linux \
-jar dist/javaproject.jar some paremeters
Another hint, if you have to open and close the program frequently, run optirun bash in a different tab so that preparing the use of the graphics card becomes faster. Alternatively, you can run optirun netbeans, but that means that the nvidia card will always be on even if you are programming which increases power use and increase the heat.
Important: if you are using a 32-bit JVM or Java libraries on a 64-bit machine, you also need to install the 32-bit drivers and libraries. For Ubuntu, the nvidia package already contains 32-bit drivers, see this answer. For other distros, you likely need to install lib32-* packages for Mesa, VirtualGL and nvidia-utils.
You can also rename java to java_real and use this portion of code as your java command :
#!/bin/bash
path=$(dirname $(readlink -f $0))
args=""
runner="$path/java_real"
for var in "$#"
do
if [ "$var" = "-3d" ]; then
runner="primusrun $runner"
else
args="$args $var"
fi
done
$runner $args
NOTE : I had to do this in /usr/lib/jvm/java-7-openjdk-amd64/jre/bin, not in /usr/bin to make it work with Eclipse.
In Eclipse, just add "-3d" in your program arguments and you're good to go !