How to set eclipse console locale/language - java

When developing web application with Eclipse (Helios) the tomcat output is being sent to the console. Ok, but the messages are being translated to my OS language.
In fact, my Eclipse is in English, but the Tomcat output (logging) is being translated to Portuguese. Probably it's a Tomcat configuration issue, but I can't find where...
How do I change this behaviour? I want my entire Eclipse in English, including Tomcat.

Go to Window > Preferences > Java > Installed JREs > select preferred JRE > Edit and then add the following to Default VM arguments:
-Duser.language=en -Duser.country=US

Try adding -Duser.language=en in the bottom of your eclipse.ini which is found in your eclipse installation directory (keep a backup copy of the eclipse.ini before any changes).

Have you tried setting the following -D parameters in the launch configuration?
-Duser.language=en -Duser.country=US -Duser.variant=EN

As #Rich and other answers said above::
You can add -Duser.language=en -Duser.country=US to the Run Configuration > VM arg for a specific java file.

Related

Start Eclipse on MacOS from Java Command line

I'm working with an older version of Eclipse, Helios SR1.
I need to be able to start eclipse from the terminal.
In review of http://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse%3F
I execute the following command in Terminal to start eclipse.
/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -jar plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
and I get
Root exception: java.lang.NoClassDefFoundError:
org/eclipse/swt/SWTError
So this appears to be more complex than what was found in the above link. If I double-click the Eclipse.app it starts right up.
I'm wondering what else needs to be done to allow the Command Line Eclipse Launcher to work properly
You should just be able to use the open command:
open /path/to/eclipse.app
or
open -n /path/to/eclipse.app
will open a new instance of Eclipse even if one is already running.
If you must use the Java command you need to specify -XstartOnFirstThread before the -jar option:
java -XstartOnFirstThread -jar ...
Use the eclipse launcher binary:
<Your-Install-Path>/Eclipse.app/Contents/MacOS/eclipse
Default start-up options are set in eclipse.ini:
<Your-Install-Path>/Eclipse.app/Contents/Eclipse/eclipse.ini
Kepler start-up options are documented here: https://help.eclipse.org/kepler/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html (Helios link redirects to Kepler, the oldest one they have kept available)
The launching process is explained in detail here: https://help.eclipse.org/2019-03/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/launcher.html

Grails default memory settings in IntelliJ

I am using Grails 2.5.1 and Java 8 with IntelliJ 14.1.4. Whenever I run any grails command (eg: clean) using the Grails Run Target (Ctrl+Alt+g), IntelliJ executes the below command:
C:\iDocs\Programs\Java\jdk1.8.0_60\bin\java -Dgrails.home=C:\iDocs\Programs\grails-2.5.1 -Dbase.dir=C:\iDocs\xxxx -Dtools.jar=C:\iDocs\Programs\Java\jdk1.8.0_60\lib\tools.jar -Dgroovy.starter.conf=C:\iDocs\Programs\grails-2.5.1/conf/groovy-starter.conf -Xmx768M -Xms768M -XX:MaxPermSize=256m -XX:PermSize=256m -Djline.WindowsTerminal.directConsole=false -Dfile.encoding=windows-1252 -classpath C:\iDocs\Programs\grails-2.5.1\lib\org.codehaus.groovy\groovy-all\jars\groovy-all-2.4.4.jar;C:\iDocs\Programs\grails-2.5.1\dist\grails-bootstrap-2.5.1.jar org.codehaus.groovy.grails.cli.support.GrailsStarter --main org.codehaus.groovy.grails.cli.GrailsScriptRunner --conf C:\iDocs\Programs\grails-2.5.1/conf/groovy-starter.conf "clean -plain-output"
Can anyone give me the location for this VM configuration (highlighted above) that I can edit, especially the PermSize and MaxPermSize?
UPDATE:
Note:
a) Adding it to VM options on Run Target window doesnt modify it.
b) Adding it to the VM options of IntelliJ executeable (idea64.exe.vmoptions) also doesnt work.
Go to (IntelliJ installation bin directory):
<Installation Dir>/JetBrains/IntelliJ IDEA <version>/bin
Modify:
idea.exe.vmoptions
idea64.exe.vmoption
This is in context to a windows setup. You can find the corresponding in OSX.
UPDATE:
For Grails application, setting up GRAILS_OPTS as environment variables is also an option.
I contacted the IntelliJ support and unfortunately, it is not supported by the IDE. An issue has been created to track the same:
https://youtrack.jetbrains.com/issue/IDEA-145433
If anyone is facing the same issue, please upvote the issue created (IDEA-145433) and comment in there.

WAR file is giving me out of memory error

I am using tomcat 6 and the WAR file I have deployed is giving me out of memory error. I have installed tomcat6 using windows installer because of it I am unable to find any catalina.bat in tomcat6.0\bin folder where I can configure CATALINA_OPTS variable.
If you are not able to find the catalina.bat then edit your tomcat6w.exe and add
-XX:+CMSClassUnloadingEnabled
-XX:+CMSPermGenSweepingEnabled
-XX:+UseConcMarkSweepGC
-XX:PermSize=128m
-XX:MaxPermSize=512m
You should change the “Xms” and “PermSize” value base on your server
capability.
Once done with editing simply Restart Tomcat.
Hope it helps!
If you have trouble setting CATALINA_OPTS in tomcat installation, you can set it as a environment variable in windows.
UPDATE:
If the previous method is not working then you can create a file, setenv.bat in bin directory of tomcat.
And in that file you can put the arguments like:
set CATALINA_OPTS= "JVM Conditions here"
This did the trick for me, try it out.
Few links for your reference:
http://www.oracle-base.com/articles/misc/apache-tomcat-7-installation-on-windows.php
How to tune Tomcat 5.5 JVM Memory settings without using the configuration program

Eclipse is not opening

I'm new to java and eclipse. I even saw this type of query on this website. But I have applied all those methods and it was also helpful. But when I try to open eclipse, it is not opening:
This is my path for java
C:\Program Files (x86)\Java\jre6
this is where my eclipse is
C:\Users\New folder\eclipse
But when I run the eclipse I'm getting an error
"A java rumtime environment(JRE) or java development kit(JDK) must be
available in order to run eclipse. No java virtual machine was found
after searching the following location: C:\Users\New
folder\eclipse\jre\bin\javaw.exe javaw.exe in your current path"
Please tell me the possible solution.
Thanks in advance!
If you have installed jdk then Eclipse won't have any issue to start. I think you just have installed JRE to run java programs. You need to install JDK.
To check whether you have installed JDK. Check Path C:\Program Files (x86)\Java. Your Java directory should contain directory jdk1.6.., If you don't have this directory there, search it at other places. If you did not find directory then you didn't install JDK.
Download JDK from here.
You should set JAVA_HOME and JRE_HOME variable. http://www.javawebonline.com/java-se-programming/beginners/java_home-jre_home-environment-variables/
And another suggestion is you should move your java home to another location and test your path to java such as
C:\Java\jre6
instead of
C:\Program Files (x86)\Java\jre6.
Go to C:\Users\New folder\eclipse
Open eclipse.ini file with text editor and add the javaw location there
( right after -vm part ) like so:
-vm
C:/Program Files/Java/jdk1.6.0_33/bin/javaw.exe <--- change to your path
-vmargs
Open the command prompt by pressing Windows+r, type cmd and press Enter.
Type javac and check the output.
If it gives all the options and usage, then you have configured the PATH vairables correctly, or else you have not set them up correctly.
Try it by checking the value at the command prompt.
NOTE
You need to open a new command prompt each time you change the environment variables.
If you have two Program Files folder in your C: drive
such as
C:\Program Files
C:\Program Files (x86)
then try to put your java inside
C:\Program Files
instead of C:\Program Files (x86)
It seems you are running 64 bit eclipse in 64 bit operating system. If you are running 64 bit eclipse then you need 64 bit JDK. Please install 64 bit JDK and run eclipse.

Where does Ant look to find your Java Home when using Eclipse?

My Ant script won't compile code. It says it doesn't find a "C:\Program Files\Java\jdk1.6.0_25". Which is correct, it should be looking for "C:\Program Files\Java\jdk1.6.0_24"
However, I don't know where it is getting the bad reference from. I seem to have 24 on Java_home and in all my Eclipse settings. Where can it be getting this other reference from? How can I fix it?
Eclipse gets his JAVA_HOME for Ant from the Project settings > Java Build Path > Libraries > JRE System Library not from Windows %JAVA_HOME% environment variable.
Normally it uses the default Eclipse JRE setting which should be C:\Program Files\Java\jdk1.6.0_24 in your case.Maybe some team member altered the project setting to C:\Program Files\Java\jdk1.6.0_25 and made a commit !?
So you have to check the project settings also, because they overwrite the general Eclipse settings.
Did you already run your antfile in Eclipse with debugmode via Run As Ant Build... and
Main Tab > Arguments > -debug > Run to get more information ?
Is there some fork=true involved in your script ?
Also put some more diagnostic output in your antfile via :
<echoproperties prefix="java"/>
<echoproperties prefix="ant"/>
to get the relevant settings logged.
you can specify which jre the ant uses in eclipse: preferences --> ant

Categories

Resources