jpaulm / drawfbp

Tool for Creating and Exploring Flow-Based Programming Diagram Hierarchies
http://www.jpaulmorrison.com/fbp/
146 stars 20 forks source link

javac problem #35

Closed jpaulm closed 4 years ago

jpaulm commented 4 years ago

Hi Alex,

Of the set you raised, the only real mystery is the javac one... I don't understand the error message!

The second line of errorMsg1 seems to suggest that it's looking for javac within refactoring/bin ! But the -d option indicates the target directory! It also says "no such directory", but I do a Java mkdirs just before that message... maybe it doesn't work in *nix...?

Can you try a few naked compiles on your system to see if we can get some more info?

I have also had problems with DOS commands under Java in the past, so we could try a different format - if you don't mind doing some experimenting...?

Thanks in advance,

Paul

adkelley commented 4 years ago

(Attaching the errMsg1 image for reference). I believe the tell is in the first line of the error message - ../refactoring/src//Step5.java, which is an invalid path to my source file because of the double slash. Note that the /bin directly (i.e., refactoring/bin) is being created during the compile process, so your mkdir is working correctly, but no .class file is created.
errorMsg1

jpaulm commented 4 years ago

Hi Alex,

The double slash should have been taken care of in today's version of DrawFBP v2.20.3 - as far as I can tell, it was only wrong in the message anyway! Could you download a new copy of the jar file from build/libs or from the appropriate release in Releases...

I still don't know why it says "in directory .....refactoring/bin". I used the "-d" option, which is supposed to tell javac the name of the target directory... 🙄 It works for me (Win10)!

I am suggesting that I could add a -verbose option, under switch control, so you could get more diagnostic information... Would this help?

Best regards,

Paul

On Tue, Apr 28, 2020 at 2:59 PM Alex Kelley notifications@github.com wrote:

(Attaching the errMsg1 image for reference). I believe the tell is in the first line of the error message - ../refactoring/src//Step5.java, which is an invalid path to my source file because of the double slash. Note that the /bin directly (i.e., refactoring/bin) is being created during the compile process, so your mkdir is working correctly. [image: errorMsg1] https://user-images.githubusercontent.com/5614766/80525325-e5d65880-8945-11ea-8d47-8241e78c50c7.png

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/jpaulm/drawfbp/issues/35#issuecomment-620794699, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACMMJ656EZKZFPHWRBQOKTRO4RQDANCNFSM4MTA6CUQ .

jpaulm commented 4 years ago

Alex, hold off a bit! I have run Compile on my system with no Java package ID, and it gives strange results, so I need to trouble-shoot that! Apologies!

jpaulm commented 4 years ago

I think it's fixed! Alex, please give it a try - you will need to download v2.20.3 jar file again...

Apologies again!

adkelley commented 4 years ago

Downloaded and tried again this morning. See attachment. The double slash is gone in the file path, and the file paths seem to be correct. To be sure it's not me, I ran the following command and it produces Step5.class within the src directory as expected:

/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/javac -cp ".:javafbp-4.1.2.jar" ./refactoring/src/Step5.java.

Let me know how I help further.

Screenshot 2020-04-30 07 04 30

jpaulm commented 4 years ago

I just realized that *nix needs colons between the -cp jar files, rather than semi-colons... Don't know if this is the problem - the error message is not very informative! So, I have made the change to v2.20.3, so I would appreciate it if you could download it again, and give it a try!

Thanks,

Paul

On Thu, Apr 30, 2020 at 10:32 AM Alex Kelley notifications@github.com wrote:

Downloaded and tried again this morning. See attachment. The double slash is gone in the file path, and the file paths seem to be correct. To be sure it's not me, I ran the following command and it produces Step5.class within the src directory as expected:

/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/javac -cp ".:javafbp-4.1.2.jar" ./refactoring/src/Step5.java.

Let me know how I help further.

[image: Screenshot 2020-04-30 07 04 30] https://user-images.githubusercontent.com/5614766/80722619-6c10ad00-8ab4-11ea-97d4-b0438de699d6.png

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/jpaulm/drawfbp/issues/35#issuecomment-621891221, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACMMJ6EBY4WSKOXLCEJRILRPGDW5ANCNFSM4MTA6CUQ .

adkelley commented 4 years ago

I'm afraid it's gotten worse. When attempting File>Compile or File>Run, I immediately get the following stack trace: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: File Chooser called using file not directory at com.jpaulmorrison.graphics.MyFileChooser.<init>(MyFileChooser.java:139) at com.jpaulmorrison.graphics.DrawFBP.compileCode(DrawFBP.java:2851) at com.jpaulmorrison.graphics.DrawFBP.actionPerformed(DrawFBP.java:1334) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.AbstractButton.doClick(AbstractButton.java:376) at com.apple.laf.ScreenMenuItem.actionPerformed(ScreenMenuItem.java:125) at java.awt.MenuItem.processActionEvent(MenuItem.java:669) at java.awt.MenuItem.processEvent(MenuItem.java:628) at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:351) at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:339) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:761) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.awt.EventQueue$4.run(EventQueue.java:729) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

jpaulm commented 4 years ago

No, actually! That's good news!!! You ran into a check I just added: the File Chooser must be invoked with a folder name, rather than a file name. I suspect that when you typed Step5.java into the folder field, it got into the wrong place! I have now made the folder field non-editable, so it shouldn't happen again...

I just added a check for this (causing your NullPointerException), but it would be better if I detected this earlier, and just used a "home" directory. I will make that change shortly...

In the interim, go into your .DrawFBPProperties.xml file, and remove the line that starts

You will have to find your folder again, but after that, DrawFBP will remember the folder name you use...

I seem to do a lot of apologizing...! 😉

Cheers,

P.

On Thu, Apr 30, 2020 at 1:34 PM Alex Kelley notifications@github.com wrote:

I'm afraid it's gotten worse. When attempting File>Compile I immediately get the following stack trace: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: File Chooser called using file not directory at com.jpaulmorrison.graphics.MyFileChooser.(MyFileChooser.java:139) at com.jpaulmorrison.graphics.DrawFBP.compileCode(DrawFBP.java:2851) at com.jpaulmorrison.graphics.DrawFBP.actionPerformed(DrawFBP.java:1334) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.AbstractButton.doClick(AbstractButton.java:376) at com.apple.laf.ScreenMenuItem.actionPerformed(ScreenMenuItem.java:125) at java.awt.MenuItem.processActionEvent(MenuItem.java:669) at java.awt.MenuItem.processEvent(MenuItem.java:628) at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:351) at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:339) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:761) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.awt.EventQueue$4.run(EventQueue.java:729) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/jpaulm/drawfbp/issues/35#issuecomment-621997891, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACMMJY2UJQCFXV7TIXMAPTRPGZD3ANCNFSM4MTA6CUQ .

bobcorrick commented 4 years ago

Hi Paul,

With the 29 April 2.20.3 I'm seeing verbose compiler output, in a window that I can't scroll. I assumed it was indicating an issue, and stopped the recording - this morning, I recompiled, closed the window with a keyboard shortcut, and continued - the code ran fine.

Perhaps a non-verbose option switch could be provided, or report errors only?

Kind regards, Bob.

On 30 Apr 2020, at 19:03, Paul Morrison notifications@github.com<mailto:notifications@github.com> wrote:

No, actually! That's good news!!! You ran into a check I just added: the File Chooser must be invoked with a folder name, rather than a file name. I suspect that when you typed Step5.java into the folder field, it got into the wrong place! I have now made the folder field non-editable, so it shouldn't happen again...

I just added a check for this (causing your NullPointerException), but it would be better if I detected this earlier, and just used a "home" directory. I will make that change shortly...

In the interim, go into your .DrawFBPProperties.xml file, and remove the line that starts

You will have to find your folder again, but after that, DrawFBP will remember the folder name you use...

I seem to do a lot of apologizing...! 😉

Cheers,

P.

On Thu, Apr 30, 2020 at 1:34 PM Alex Kelley notifications@github.com<mailto:notifications@github.com> wrote:

I'm afraid it's gotten worse. When attempting File>Compile I immediately get the following stack trace: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: File Chooser called using file not directory at com.jpaulmorrison.graphics.MyFileChooser.(MyFileChooser.java:139) at com.jpaulmorrison.graphics.DrawFBP.compileCode(DrawFBP.java:2851) at com.jpaulmorrison.graphics.DrawFBP.actionPerformed(DrawFBP.java:1334) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.AbstractButton.doClick(AbstractButton.java:376) at com.apple.laf.ScreenMenuItem.actionPerformed(ScreenMenuItem.java:125) at java.awt.MenuItem.processActionEvent(MenuItem.java:669) at java.awt.MenuItem.processEvent(MenuItem.java:628) at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:351) at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:339) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:761) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.awt.EventQueue$4.run(EventQueue.java:729) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/jpaulm/drawfbp/issues/35#issuecomment-621997891, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACMMJY2UJQCFXV7TIXMAPTRPGZD3ANCNFSM4MTA6CUQ .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/jpaulm/drawfbp/issues/35#issuecomment-622012129, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABZLBJHCDF4FO7UCMIKWVSDRPG4NLANCNFSM4MTA6CUQ.

jpaulm commented 4 years ago

Hi Alex,

It looks like you are not using a package declaration in your code - apparently it is not necessary, but it seems to be good practice! See below...

DrawFBP gets a bit confused if you don't have a package declare, or if it doesn't match your directory structure, so I should probably revisit my code, but you may get odd results with the present version of DrawFBP if you don't have a package... I'm kind of surprised you haven't had a problem with that yet! 🤔

https://stackoverflow.com/questions/17797941/do-i-have-to-use-package-term-in-every-class

Pls let me know how you are making out with Compile and the latest version...

Thanks,

Paul M.

On Thu, Apr 30, 2020 at 1:34 PM Alex Kelley notifications@github.com wrote:

I'm afraid it's gotten worse. When attempting File>Compile I immediately get the following stack trace: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: File Chooser called using file not directory at com.jpaulmorrison.graphics.MyFileChooser.(MyFileChooser.java:139) at com.jpaulmorrison.graphics.DrawFBP.compileCode(DrawFBP.java:2851) at com.jpaulmorrison.graphics.DrawFBP.actionPerformed(DrawFBP.java:1334) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.AbstractButton.doClick(AbstractButton.java:376) at com.apple.laf.ScreenMenuItem.actionPerformed(ScreenMenuItem.java:125) at java.awt.MenuItem.processActionEvent(MenuItem.java:669) at java.awt.MenuItem.processEvent(MenuItem.java:628) at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:351) at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:339) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:761) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.awt.EventQueue$4.run(EventQueue.java:729) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/jpaulm/drawfbp/issues/35#issuecomment-621997891, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACMMJY2UJQCFXV7TIXMAPTRPGZD3ANCNFSM4MTA6CUQ .

jpaulm commented 4 years ago

Hi Alex,

Not sure if you have downloaded DrawFBP v2.20.4, but, if you did yesterday, you may have an odd value in the DrawFBPProperties.xml file... I believe I have fixed it, so perhaps you could download it again, and give it a try... OTOH, if you are more comfortable staying with v2.20.3, that would be fine too!

Cheers!

jpaulm commented 4 years ago

I have running cases on DrawFBP for a couple of weeks now, with no package specified in the Java source - and no problems now! Haven't heard back from Alex about his last javac problem, so I am going to assume that it was due to need to use colons. I will close this - Alex, if this is not correct, please reopen.