spywhere / Javatar

Java Development Plugin for Sublime Text 3
https://javatar.readthedocs.org/
Other
170 stars 20 forks source link

File is not compiled #45

Closed eickhardt closed 9 years ago

eickhardt commented 9 years ago

I'm having trouble following the guide found here: http://javatar.readthedocs.org/en/latest/getting_started.html

Everything goes well untill I reach the final step "Running Our Code". Here I get an instant error that says "File is not compiled". I'm a Java noob aswell, but I'm guessing there should be something in the '/bin/javatar/simple/demo' folder, but it's empty. Any help would be greatly appreaciated.

My action history:

Javatar Report

System Informations

I think your plugin is awesome, and I really want to use it. My apologies if I have overlooked something obvious.

spywhere commented 9 years ago

First of all, from the action list, seems like you try to restart Sublime Text and try again. That's a good idea to do but unfortunately, that also remove most of the commands you already done in that session.

So, in order to solve this issue, could you please send me the following things?

  1. A screenshot of Sublime Text before compile your code.
  2. A Sublime Text's console log after compile your code.
eickhardt commented 9 years ago

Thank you for your swift reply.

Your suggestion prompted me to start over from scratch without restarting sublime, and that did the trick. After deleting all files and going through the guide again, my program compiled and asked me what my name is. You deserve all the internet points I can give! Thank you. The only two messages that where in my console are:

reloading Packages/User/Javatar.sublime-settings ReadDirectoryChangesW fails with ERROR_ACCESS_DENIED

Does this mean however that there are certain times when I should not restart sublime to avoid this?

spywhere commented 9 years ago

Yes, if you are working with a new project but not save it to the (.sublime-project) file yet, when you open the project second time, the changes and settings on that particular project might be lost too (since Sublime Text did not preserve the project data on quit).

This project data contains some Javatar project settings including Source Folder, Target JDK or Dependencies which leads to invalid source folder and failed the compilation hence you cannot run the uncompiled code.

eickhardt commented 9 years ago

I see, thank you for the clarification!

Ingli commented 9 years ago

I ran into the same problem. Since I believe that this is an issue that many users of Javatar are confronted with, may I suggest to add a function "Build from scratch", or "Clean up project" or so. This way, we may be able to rebuild the project and run it.

spywhere commented 9 years ago

By default, Javatar always recompile the files (base on what you choose in the build dialog). But in v2.0.0 Javatar now compile only the file that has been changed (base on modified time) so I will add the clean up for Javatar 2.0.0 for this.

Ingli commented 9 years ago

Thanks a lot! I think I'm getting closer to what the issue is. Javatar, in its current version may not handle CLASSPATH entirely correct. Try to build a complex project with several directories and packages and then compile and run a single class inside a package. The separation of /bin and /src may cause the problem or changing package paths in the shell/directory manager. Some basic directory function such as move or copy could help. Does Javatar move into /bin and use the package syntax correctly? Using java -cp .: package.MyClass in the shell in /bin works fine after compiling with Javatar. For this, it would be great if there was a little window in ST3 where we can see which shell commands are executed. Just saying... I like Javatar! Great contribution!

Edit: Getting even closer. I just created a new class and by default, it named the package src.MyClass. Executing the build by adding src. to the class such as package src.MyClass Hope this helps.

spywhere commented 9 years ago

Javatar does offer you a output directory by changing the build_output_location in the settings file.

Sadly, Javatar v1.0 does not show an actual command anywhere (but v2.0 does show in the console). However, you can take a look at an overview of the full command in the build_command or run_command option in the settings file.

The commands that Javatar building up can be varies based on the settings you choose. Just like when you try to compile a file on your desktop but currently you are in the document directory since Javatar have build_location and run_location to specify a working directory for the command to be used.

Hope this might answer some of your questions on that.

spywhere commented 9 years ago

If possible, could you try using v2.0 instead and evaluate how Javatar should be improve?

I really want the v2.0 to suits the larger project (not as large as Maven or Gradle project, but that would be a great addition to add). So, right now v1.0 is really slow due to how the Javatar compile the files and also lack the supports for multiple source folders and some of the improvements that would be useful.

Currently, I working on an auto-completion feature and when it finished, the v2.0 is almost ready to me. So, if any addition could be add in the first release of v2.0, that would be great.

wubin1989 commented 7 years ago

how to 'save it to the (.sublime-project)' ??