Been using eclipse for a short while. I run ubuntu 10.10 and have installed Eclipse web tools platform plug-ins for ecplise and the php development tools plug-in, when I started a php project I also installed the php perspective, but this doesn't work when I run php files?!
I get this error
Unsupported content type in editor
So when I edit php files I use the Java perspective. This works. I can't say that eclipse impress much with all these weird errors when I install every thing by default and are only doing simple tasks, like editing a php file with a php editor..
I also get this error when I open .tpl files (smarty template engine files)
Could not open the editor: The editor
class could not be instantiated. This
usually indicates a missing no-arg
constructor or that the editor's class
name was mistyped in plugin.xml.
Thats my main problem.
I had the same error namely: Unsupported content type in editor
And solved it this way: You need to open it in navigator (window -> show view -> navigator) not the php perspective or project view or anything else.
At least this worked for me hope it also helps you!
After doing the file association,You need go to preference general > content type > Text and add extension For example , I need *.tpl to be open in HTML editor, than I can do like below.
This seems to be related to your JRE installation.
See those two forum threads:
http://forum.gentleware.com/viewtopic.php?t=4113
http://www.anddev.org/eclipse_fails_to_load_editors_sometimes-t3156.html
Quote:
Reasons could be manifold.
Most popular: You're running Apollo
for Eclipse with JRE version < 1.5.
Look for a line saying
java.vm.version=xxx in Help->About
Eclipse SDK->Configuration Details
Related
I am using sublimetext3 unregistered . I want to know how can I configure sublime to show unused and undefined variables in php .sublimelinter-phplint does some useful work but it cannot recognise autoloaded classes that can be very irritating while development .I am looking for some package that can do it with file scope.
I have following packages already installed
sublimelinter
phpcs
3.sublime-phpcs
Is there anyother package that can be userful in developement ?
http://phpmd.org will show unused code. there is a SublimeLinter-phpmd extension as well. Just install both SublimeLinter and this extension, open the User preferences for SublimeLinter, and reduce the phpmd rulesets to just "rulesets": "unusedcode" to avoid over reporting on conventions and such you might not use.
SublimeLinter works quite well but for php I use an extension :
https://github.com/SublimeLinter/SublimeLinter-php
You need SublimeLinter 3 for this : http://sublimelinter.readthedocs.org/en/latest/installation.html
Which i see you already have! ^^
Appart from that.. Another IDE ? ^^
A Note about another editor which has a LOT of tools.. ATOM
I've downloaded the Eclipse PDT package as well as however, I can't find any options for formatting my PHP such as specifying line breaks, etc.
In this answer to another question, https://stackoverflow.com/a/3517764, there is a screenshot of what I understand is what I should be seeing. However, all I see is an extremely basic setting panel where I can set whether or not I want spaces or tabs to be used and how many to be used.
Any help on getting a good formatter would be great.
Ideally, it'd be a formatter for within Eclipse as opposed to another tool.
I'm currently using Eclipse Juno 4.2.2
Cheers
From what I see, PDT 3.1.x branch doesn't have a fully customizable code formatting rules. If you go and install/update to PDT 3.2 branch you'll get java-like code formatting options.
In Eclipse Juno go to:
Help > Install New Software
Click the "Add" button that appears near the top right
For Name you can put "PDT 3.2 Release" (or whatever you want really)
For Location you HAVE to put http://download.eclipse.org/tools/pdt/updates/3.2/release
Once you update/install PDT and restart eclipse if you go to
Window > Preferences > PHP > Code Style > Formatter
You'll see a highly customizable formatter to use.
Note, I got the link for the 3.2 release from: http://projects.eclipse.org/projects/tools.pdt
I've installed Eclipse PDT Helios SR1 GTK for 64bit Linux (Ubuntu Maverick clean install).
I added the Subversive plugin for using Subversion, and installed the SVNKit 1.3.2 connector.
I'm using Sun's java and not the OpenJDK version.
When I synchronize a php project, and double click a php file for comparing the differences I made compared to the base revision - it opens a window of a compared file, but the window is empty - I see the gray background as if no file is opened.
When I open files which are not set as a PHP file, it works fine.
(If I'll take a file with a .module extension and define it as a php file in the Content Types preferences pane, it will act badly as described above. If I'll remove this definition, it will work [as if I compared a plain text file]).
Anybody has any idea why is this happening ?
If I missed any important information that will help diagnose or solve this issue, lemme know and I'll add it.
Thank you.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=326194
There's a fix that you can install, although it's on a non-release update site.
Unbelievably, they still haven't fixed it in the main update site.
We are currently using Aptana for PHP and Eclipse for Java. While Aptana is built on Ecplise, it treats PHP files differently when they won't parse/compile. I'd love to use Eclipse for both, but I can't figure out how to suppress errors that should be ignored.
We use simpletest for all of our projects so we have it included in our "core" project and check it into SVN. Simpletest includes "test_with_parse_error.php", which is an invalid php file. In Aptana, the project does not show as having an error (nor does any php file) until you open it. At that point, you can see that the file has an error, but the project as a whole doesn't change (there is no "red X" on the directories where the file is located).
It almost appears as if Aptana treats folders as regular folders while Eclipse (galileo) treats all folders in a PHP project as "source folders". Is there a way to specify which folders should be considered "source" and which should not when looking for errors?
starting with eclipse PDT 2.0, you can exclude resources from the build process using the PHP Build Path configuration. this will also suppress warnings from the invalid file.
If Aptana is build on Eclipse, couldn't you just configure it to show the Java view? I could configure my Zend studio (also built on Eclipse and very much like Aptana) to show the Java view/workspace and work with it..
I have a project that's intended to use some PHP as well as Java and Javascript, so I installed the PDT PHP plug-in for Eclipse, using the Install New Software menu option. Now Eclipse agrees PDT is installed, but no PHP features like creating or editing PHP files are appearing anywhere. Is there something else I need to do to activate PDT? (I did restart Eclipse like it said I needed to.)
Right click on your project, Configure (it's at the bottom of the list)->Add PHP Support...
After it's done, you should see a little P symbol in the project's icon.
Just create new project using the wizard, and choose PHP one. After Eclipse will know that your project is actually based on PHP, it will show you all the features.
In case if you have existing project, just open the PHP perspective.
I've once had a similar problem. Eclipse was running with the JRE 1.4, and it seems the JRE 1.5 or later is required to run the PDT. I switched to Java 1.6 and that solved the problem.
I run into this sometimes with eclipse plugins.
Have you tried uninstalling it, removing the jar and files it from eclipse/plugins and eclipse/features, then installing it again?
If you don't feel like doing that. Try installing it in a clean eclipse instance and if it works then it's just a config issue with eclipse.
You might have not installed all of the tools too.
The solution I eventually came up with was to just install Aptana Studio, a PHP IDE based on Eclipse, whose standalone version can coexist happily with the regular Eclipse on the same machine.
In order to have PHP support in eclipse project, you need to add PHPNature to the project. It's a kind of configuration paramter of eclipse project. When you craete a new PHP project using a wizard, check the .project file in a new project directory. There is a PHPNature line. Copy this line into .project of your java project.
Another solution is to separate java and php code in a different projects, each one craeted by right wizard.