We're still in the early stages with these, so please let us know what questions you have!
On Running SAFARI
- Q. I see that I need to create my SAFARI IDE in a plugin project. Is there any particular sort of plugin project that I need?
- A. The default values that you get when you create a new plugin project (File -> New -> Project ... -> Plugin-Project) are almost exactly what you need.
On the first page of the New Plug-in Project wizard, you do want the default project contents, you do want to create a Java project, and you do want to create a OSGi bundle manifest.
On the second page, you can set the plugin properties in whatever way is appropriate. You defnintely want to generate a plugin-class, and this class will make contributions to the UI. If your IDE project will have the same name as your language, then you should not edit the name of the plug-in class. If your project will have a different name from your language, then you will need to edit the plugin-class name (see elsewhere in the FAQ and other documentation about this). You do not want to create a rich-client application.
On the third page, you do not want to create a plug-in using one of the templates.
This will give you a perfectly good plugin project for SAFARI.
- Q. What JVM does SAFARI require?
- A. Safari will not work in an Eclipse that is running on a JVM before 5.0. Assuming that you have a version 5.0 JVM installed on your computer, you can assure that Eclipse runs with this JVM by using the -vm argument when Eclipse is invoked.
- Q. SAFARI can't load a wizard class: When I try to run the first SAFARI wizard, the "Programming language descriptor" wizard,I immediately get an error pop-up that says "The selected wizard could not be started..."; why couldn't the wizard be started?
- A. This message will occur if you are running Eclipse with a version of the JVM that predates 5.0. You must run SAFARI in an Eclipse workbench that is running on JVM 5.0 or later.
- Q. Can't start "Programming language descriptor" wizard: When I run the Eclipse "New" wizard (File -> New), select "Programming language descriptor", and click "Next", nothing happens. There is no visible effect, no error message, and the "Next" button remain enabled. What has happened?
- A. One possible cause is that no plug-in project is selected. The "Programming language
descriptor" wizard (and all SAFARI wizards) must be executed in the context of a selected
project, and this project must be a plug-in project. Usually this is hard to avoid, but
when you first start Eclipse it comes up with no project selected. If you invoke the
"Programming language descriptor" wizard in this state nothing constructive will happen.
We should provide better feedback about this. In the meantime, you can see an indication of the error by looking in the Error Log for the workbench in which you tried to run the wizard. If you did this in a runtime workbench, then you may also see a stack trace for an IllegalArgumentException in the console for the parent workbench.
- Q. Wizard doesn't finish: I am able to run a particular wizard and fill in the fields, but when I click on the "Finish" button nothing seems to happen. There is no error message and the wizard remains enabled. Why does nothing happen?
- A. Probably there has been some internal error in the wizard. You may be able to find
some indication of the problem in either of two different places. Check the Error Log of
the workbench in which you are trying to run the wizard. Also, if the workbench is a
runtime workbench, then you may see an exception and stack track reported in the console
for the parent workbench.
If SAFARI did not put up an error message or diagnostic report, then it would be a help to us if you would file a bug report about this problem (if there doesn't seem to be one for it already).
- Q. I'm generating services for my IDE, and I noticed that my plugin project has two plugin classes. Is that okay?
- A. No, you should only have one plugin class. One easy way to end up with two is to give your language a different name than the name of the project in which you're developing your IDE. It is perfectly fine to do this, but then you need to take measures to assure that the plugin project and SAFARI agree on the name of one plugin class.
Suppose that your plugin project is called "fooIDE"; then by default Eclipse will name the plugin class "fooIDE.FooIDEPlugin". Now suppose that your language is called "fooLang". When you create a new SAFARI programming language description, SAFARI will by default create a plugin class "fooLang.FooLangPlugin". If you know that the name of your language will be different from the name of your IDE project (and you know what both names are), then one way to avoid the problem is to edit the default project plugin name when you create the plugin project.
Unfortunately, the SAFARI new "Programming language descriptor" wizard doesn't currently offer the same opportunity to change the name of the name of the plugin class that SAFARI generates, but we can look into changing that.
Of course, the other thing you can do is to give your plugin project and language the same name, if that's not a big inconvenience.
If you've moved beyond the stage of creating your project and defining your language, and you would prefer not to start over with that, you can try editing the metadata in your project to change the plugin associated with the project. Open the plugin.xml file in the Plug-in Manifest Editor and go to the Overview tab. Under General Information, browse for the langauge plugin class, select that, and save the plugin.xml file. (For SAFARI purposes, the language plugin class is the one you need as it will have the SAFARI specific information.) This may be enough to get the appropriate plugin class properly aligned with both the language and project. (We don't know of anything more that would need to be adjusted, but we haven't tried this very often.)
- Q. After I run the JikesPG Grammar and Parser Wizard, the generated ParseController contains several compile errors because the import "lpg" cannot be resolved. What should I do?
- A. When you run the JikesPG Grammar and Parser Wizard, a dependency on lpg.runtime is added to the plugin.xml file for your IDE project. However, it seems that Eclipse does not necessarily recoginze that the dependency has been added. To prompt Eclipse to recognize the new dependency, go to the Dependencies tab in the plugin.xml file for the project, make an insignificant change to the dependency list (for example, move the lpg.runtime dependency up and down), and then save the plugin.xml file. This should prompt Eclipse to recognize the new dependency, which in turn should cause the project to be rebuilt, and the compile errors should disappear.
- Q. I ran the Incremental Builder wizard for my IDE, and a builder was generated, but I don't get any building in my development project. What should I do?
- A. For Eclipse to invoke the builder automatically on a development project, it has to be associated with the project. There is documentation about this in the SAFARI User's Guide and cheat sheets. The simple fix is to run the Nature Enabler wizard on your IDE project. Then go to your development project and right-click on the project. You should see a menu item that says "Enable languagename Builder" (which was created by the wizard). Selecting that item should enable your builder to run automatically on that project.
- Q. I ran the "Poor Man's Compiler" wizard for my IDE, and a compiler was generated, but I don't get any compiling in my development project. What should I do?
- A. The compiler is ordinarily invoked by the builder. If you have run the Incremental Builder wizard for your IDE, then the generated code for the builder should contain a couple of commentd-out lines that would call the compiler. If you un-comment these lines, the compiler will be invoked from your builder. Note: When you uncomment the lines, you may see that the compiler class is not recognized--there is no import statement for it. You will need to provide the import statement for the builder class to compile with these lines (try CTRL-Shift-O).
If you have done the above and it still doesn't seem that the compiler is running automatically, be sure that your builder is running automatically. For more about that, see the previous question.
- Q. I have generated "Poor Man's Compiler" and the compiler is running, but the Java code generated by the compiler has a Java compile error due to a call to a parameterless "main" function (and I didn't even write a parameterless "main" function!). What should I do?
- A. The basic Poor Man's Compiler generates Java code that automatically includes a call to a parameterless "main" function so that the generated code can be executed. To make your code executable, you actually should write a parameterless "main" function (that in turn calls a "real" function in your code).
If you really don't want a parameterless main function in the generated Java code, then you should probably modify the generated Poor Man's Compiler code to prevent that.
On Running X10DT
These are still more of the way example questions, but you could have them ...
- Q: I've installed SAFARI/X10DT, but I see no syntax highlighting and there's nothing in the Outline View. What gives?
- A: You need to be running Eclipse on a Java 5 VM. To do that,
either make sure that the default VM on your system is a Java 5 VM, or
use the '-vm' command-line option (which takes a fully-qualified path
to the javaw.exe executable) to the eclipse.exe launcher. [Note that
this option must appear in the command line before any
"-vmargs" option.]
On Windows, there are two ways to do this: (1) if you launch eclipse using a shortcut, you can add the '-vm' option by editing the shortcut's "Target" field (on the "Shortcut" page of the shortcut's properties dialog), or (2) in any case, you can add this option to the file eclipse.ini in the same directory as the eclipse.exe executable.
- Q: I've installed SAFARI/X10DT, and I'm running on a Java 5 VM, but I see no syntax highlighting and there's nothing in the Outline View. What gives?
- A: Eclipse "kindly" remembers the editor last used on any given file, and will occasionally decide to revert back to the ordinary text editor. So: right-click on the file in the Package Explorer, and select "Open With..." => "SAFARI Editor". You should get your highlighting and outline back.
- Q: None of the FAQ's answer my question and "xxx" is broken. What do I do?
- A: If you have access to the SAFARI
Bugzilla server (which may for the time being be restricted to users within the IBM Intranet)
then you can file a bug report. Please check to see whether there are any errors
in the "Error Log" view, and, if so, include the contents of any
relevant errors in the log, along with any associated stack backtrace.
If you don't have access to the SAFARI Bugzilla server, then please send a report to the SAFARI Project Lead.
