Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDT not activating on Vim #5

Open
chloeoxe opened this issue Jan 12, 2022 · 2 comments
Open

JDT not activating on Vim #5

chloeoxe opened this issue Jan 12, 2022 · 2 comments
Labels
🔧 Technical Issues Issues with regards to setting up of Vim, Java etc.

Comments

@chloeoxe
Copy link

Summary

JDT not activating despite creating a file called 'HelloWorld.java'

Description

I use mac and on my terminal, I managed to create a file using 'vim HelloWorld.java' as what is shown in the Luminus 'Intro to Java' video. However, in the video, right after creating the HelloWorld file, the JDT started loading and activating but this is not the case for me. Instead, the supposed 'Java' file acted more like a regular txt file (see image attached) and I'm assuming it's because my JDT does not activate automatically. Is anyone else a mac user and also experiencing such a problem? Does anyone know how to fix this? Any input would greatly help. Thank you!

Screenshots (if any):

Screenshot 2022-01-12 at 9 41 39 PM

@chloeoxe chloeoxe added the 🔧 Technical Issues Issues with regards to setting up of Vim, Java etc. label Jan 12, 2022
@wjahoward
Copy link

wjahoward commented Jan 12, 2022

Hello! You do not really require JDT in order to run the Java file on Vim, though it might be helpful in writing your code faster as compared to writing the code everything manually from scratch.

Your current file is in a correct and valid .java format. You can test if is working fine by writing the command on Terminal java HelloWorld.java, which your current code will throw an error as there is no public static void main(String[]) function.

Your HelloWorld.java file can include something like this:

class HelloWorld {
  public static void main(String[] args) {
    System.out.println("Hello World");
  }
}

And you should expect to see an output after running java HelloWorld.java command on Terminal:

Hello World

I did include some syntax highlighting to identify the keywords easily. These are the steps as such:

  1. vim ~/.vimrc

  2. Type :syntax on

  3. Open any .java file and you should see something like this:

image

Hopefully this helps and clarifies your doubt! :)

@chloeoxe
Copy link
Author

Ohhh I see! Initially after watching the Luminus video, I thought that every time we started a java file, shortcuts would be immediately activated which would allow for faster coding like how the TA coded the 'public static void main(String [] args)' in an instant. However, yes I did try coding out the HelloWorld class manually, complied it, and it ran successfully! Now I know that actually Vim and Java does work properly for me and the shortcuts in the video are optional to allow for faster coding, thank you for the help as well as the syntax highlighting tip! It really helped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔧 Technical Issues Issues with regards to setting up of Vim, Java etc.
Projects
None yet
Development

No branches or pull requests

2 participants