Windows 10: How do I add new .java file to context new menu?

Discus and support How do I add new .java file to context new menu? in Windows 10 Support to solve the problem; Hello, I want create a new blank java source code file from the context menu when I right click in a folder and select new. I have tried adding a... Discussion in 'Windows 10 Support' started by RedBushTea, Aug 1, 2017.

  1. How do I add new .java file to context new menu?


    Hello, I want create a new blank java source code file from the context menu when I right click in
    a folder and select new.

    I have tried adding a registry edit with the following code:

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\.java\ShellNew]
    "NullFile"=""

    This does not work even after a restart.

    :)
     
    RedBushTea, Aug 1, 2017
    #1
  2. Andre Da Costa, Aug 1, 2017
    #2
  3. Bruce Hagen, Aug 1, 2017
    #3
  4. bro67 Win User

    How do I add new .java file to context new menu?

    First question would be why. The second would be what are you trying to accomplish.
     
    bro67, Aug 1, 2017
    #4
  5. docpipo Win User
    Did you set a value?
     
    docpipo, Aug 1, 2017
    #5
  6. I want to do this so that I can create a new java source code file from the context menu, then I will open the file in
    a text editor and write the java source code as part of a set of java programming lessons.

    I can create a new text file from the context menu and then rename the file extension to .java or other work around
    methods but I think having a menu item in the context menu will be better.
     
    RedBushTea, Aug 1, 2017
    #6
  7. I did not set a value as I copied the code from another forum, and as far as I know this code will allow a new blank file
    to be created.
     
    RedBushTea, Aug 1, 2017
    #7
  8. docpipo Win User

    How do I add new .java file to context new menu?

    I'd say try setting it to 1, and see what happens. I tried it but I didn't look up a code yet and I'm no expert, just a suggestion
     
    docpipo, Aug 1, 2017
    #8
  9. Thanks, I changed the value to 1 as you suggested but it still does not work.
     
    RedBushTea, Aug 1, 2017
    #9
  10. After some research and trial and error I have got it working, I found useful information in various web pages
    including:
    windows - How can I add an item to the context menu? - Super User
    and
    Adding Items to the "New" Context Menu (Tips.Net)

    So after making changes to the registry and exiting regedit, I had to close all Explorer windows and then restart Explorer for the changes to take effect.

    Below is the code I have exported from regedit, I don't know if all the changes are needed but it works

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\.java]
    "PerceivedType"="text"
    @="JavaSourceFile.Document"

    [HKEY_CLASSES_ROOT\.java\PersistentHandler]
    @="{5e941d80-bf96-11cd-b579-08002b30bfeb}"

    [HKEY_CLASSES_ROOT\.java\ShellNew]
    "NullFile"=""
    "FileName"="C:\\Windows\\ShellNew\\Template.java"
    "~NullFile"=""

    [HKEY_CLASSES_ROOT\JavaSourceFile.Document]
    @="JAVA Source File"

    [HKEY_CLASSES_ROOT\JavaSourceFile.Document\DefaultIcon]
    @="C:\\Program Files (x86)\\Notepad++\\notepad++.exe,0"
     
    RedBushTea, Apr 4, 2018
    #10
Thema:

How do I add new .java file to context new menu?

Loading...
  1. How do I add new .java file to context new menu? - Similar Threads - add java file

  2. How can i add a new item in the new Windows 11 main context menu?

    in Windows 10 Software and Apps
    How can i add a new item in the new Windows 11 main context menu?: I want to add a new item or at least move one from the "Show more options" to the main context menu in Windows 11. The app i want to move is the VS Code, it has the "Open with Code" item in the "Show more options", but it will really help to have it in the main one. I saw...
  3. How can i add a new item in the new Windows 11 main context menu?

    in Windows 10 Gaming
    How can i add a new item in the new Windows 11 main context menu?: I want to add a new item or at least move one from the "Show more options" to the main context menu in Windows 11. The app i want to move is the VS Code, it has the "Open with Code" item in the "Show more options", but it will really help to have it in the main one. And I saw...
  4. I can't add .xlsx in context menu in New group

    in Windows 10 Software and Apps
    I can't add .xlsx in context menu in New group: I have Office 2016. Key is Excel.Sheet.12, inside ShellNew, inside string value named FileName, value is excel12,xlsx. But i don't see excel in context menu > new. Word in ShellNew has NullFile. i tried that for .xlsx too but no effect. On...
  5. I can't add .xlsx in context menu in New group

    in Windows 10 Customization
    I can't add .xlsx in context menu in New group: I have Office 2016. Key is Excel.Sheet.12, inside ShellNew, inside string value named FileName, value is excel12,xlsx. But i don't see excel in context menu > new. Word in ShellNew has NullFile. i tried that for .xlsx too but no effect. On...
  6. How do I restore new => Folder to context menu?

    in Windows 10 Network and Sharing
    How do I restore new => Folder to context menu?: Hi there The other day I discovered out of the blue New =>Folder had disappeared from the context menu. I have been forced to create new folders by copying an existing folder, renaming it & deleting its content. I have absolutely no reason what could have lead to this, but...
  7. Desktop Context Menu: New No .txt file in there. How to add etc.

    in Windows 10 Support
    Desktop Context Menu: New No .txt file in there. How to add etc.: Hello Everyone, I recently noticed in the Desktop Context Menu: New no longer has the .txt file option. Does anybody know why? If it is legitly gone how do I add it back into the context menu? Before windows 10 on the task bar when you right click on an icon you were...
  8. Add Registry File to New Context Menu in Windows 10

    in Windows 10 Tutorials
    Add Registry File to New Context Menu in Windows 10: How to: Add Registry File to New Context Menu in Windows 10 [img] Information .Reg files are registration entries that are text-based human-readable files for exporting and importing portions of the Registry. The New context menu allows users to quickly create new...
  9. Add Batch File to New Context Menu in Windows 10

    in Windows 10 Tutorials
    Add Batch File to New Context Menu in Windows 10: How to: Add Batch File to New Context Menu in Windows 10 How to Add Windows Batch File to New Context Menu in Windows 10 A .bat file is a batch file that consists of a series of commands to be executed by the command line interpreter, stored in a plain text file....
  10. Add VBScript File to New Context Menu in Windows 10

    in Windows 10 Tutorials
    Add VBScript File to New Context Menu in Windows 10: How to: Add VBScript File to New Context Menu in Windows 10 [img] Information A .vbs file is a VBScript (Visual Basic Script) file written in the VBScript scripting language that can be executed within Windows or Internet Explorer via the Windows-based script host...