Archive

Archive for the ‘Eclipse’ Category

Difference between refresh and clean in Eclipse

If you modify or add new files outside Eclipse the file system will often be out of synch in Eclipse and new files may not show up in the Eclipse project tree. To synch the Eclipse Project select the project and select File > Refresh (or F5), or right-click on the project and select Refresh from the popup menu. Then do a clean build by selecting Project > Clean, selecting the project, and clicking OK.

  • Refresh rereads the sourcefiles to see if there are changes made outside Eclipse and compiles the files that were changed, not all of them.
  • Clean removes all compiled classes and forces recompilation of the entire project (or workspace depending on what you select to be cleaned).
Advertisements
Categories: Eclipse

Eclipse Error: Failed to load the JNI shared library … \jre\bin\client\jvm.dll

I tried to start a fresh downloaded Eclipse IDE (eclipse-SDK-4.2.2-win32-x86_64.zip) and got the following message:
Failed to load the JNI shared library “C:\Program Files (x86)\Java\jdk1.7.0_06\bin\..\jre\bin\client\jvm.dll”.

2013-05-29 18_02_09-Edit Post ‹ Chris's little Blog — WordPress

Check if you use a 64bit JDK to start the 64bit Eclipse. The 64bit JDK should be in “C:\Program Files\Java\..”

You can specify a specific JVM in the eclipse.ini file with the -vm argument:
-vm
C:\Program Files\Java\jdk1.7.0_21\bin\javaw.exe

The -vm option must occur before the -vmargs option, since everything after -vmargs is passed directly to the JVM.

Categories: Eclipse, Misc

Maven Eclipse Compiler Error “No compiler is provided in this environment. …”

I got the following compilation error while running the Maven install command from Eclipse:

“No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?”

Go into Window > Preferences > Java > Installed JREs > and check your installed JREs. You should have an entry with a JDK there.

2013-03-08 10_37_19-Preferences

Go into Window > Preferences > Java > Installed JREs > Execution Environments

Select JavaSE-1.6, click the jdk checkbox on the right. Then use “update project configuration” from the maven menu.
2013-03-08 10_55_36-Preferences

For more informations about Maven and Eclipse have a look at the book of Sanjay Shah
here.
Maven-for-Eclipse

Eclipse Error: “Enabling Maven Dependency Management” has encountered a problem

February 17, 2013 7 comments

The following error apears if one imports a project which was created with Maven (mvn eclipse:eclipse) and tries the “Configure” -> “Convert to Maven Project” function:
An internal error occurred during: “Enabling Maven Dependency Management”. Unsupported IClasspathEntry kind=4

To fix this error open the project with Eclipse, run the “mvn eclipse:clean” command and try the “Configure” -> “Convert to Maven Project” function again.

Categories: Build-Management, Eclipse

Change the default language for Eclipse User Interface

Start Eclipse with the -nl argument followed by the language en_US (for United States English) such as:
eclipse.exe -nl en_US

OR

Add the variable -Duser.language=en into the file eclipse.ini under the VMArgs section as shown below:

-vmargs
-Duser.language=en

Categories: Eclipse

Java line wrapping in Eclipse editor

Open preferences and search for “Format” or select Java->Code Style->Formatter from the left menu. The default profile is called “Eclipse [built-in]” and if you want to make changes to the Java Formatter you will need to copy it and create your own profile. This can be done with the “New” button right below the profile name.

Once you have created your own Java Formatter, make sure it’s selected and hit the edit button. Select the “Line Wrapping” tab. Under general settings you will see “Maximum line width:”. Set this to a numerical value  such as 180 characters. Save and apply that and return to your code.

Categories: Eclipse, Misc