Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7649883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:06:27+00:00 2026-05-31T11:06:27+00:00

I am quite new to VIM and trying to run a small java code

  • 0

I am quite new to VIM and trying to run a small java code to test whether its working or not but its showing error.

Error: Couldn't find or load main class test.java

This the command I used:

:!java test.java

My Code:

public class test{

    public static void main(string[] args){
        System.out.println("Hello world");
    }
}

I tried to fix it by following some some question in this site but couldn’t make it.
Ex: :!java -cp test.java

This is the the Java Plugin I installed for VIM LINK
However, as the above plugin offers F5 to do all the process, its showing an error.

:!jikes + E test.java >c:\users\username\appdata\local\temp\VIeA690.tmp 2>&1 shell returned 1 (1 of 2): 'jikes' is not recognized as an internal or external command

So, I wonder if anyone could help on it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T11:06:29+00:00Added an answer on May 31, 2026 at 11:06 am

    You would have to compile the java source file then run the compiled class file:

    javac test.java
    java test
    

    From within vim, the keystrokes would be:

    :!javac test.java ; java test
    

    but that’s an awful lot to type in to compile and run. I’d tend to just open up another window and run a script (called something like x to minimise keystrokes) to compile and run, leaving me to only need saving in the vim window.

    However, the plug-in you installed is supposed to make that easier by assigning the save, compile and run operations to a function key F5 so I’m not sure why you’re not doing that.

    Based on your comment that you’re seeing:

    javac is not recognized as an internal or external command, operable program or batch file

    there’s a very good chance you don’t have a Java compiler installed. At a bare minimum, it’s not in your path. You need to fix that first. While things like Eclipse come with their own compiler, you generally need to install and configure something like javac if you’re using something like vim.

    In any case, java runs class files – it doesn’t compile source files.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am quite new to vim and I am trying to edit coffeescript. Whenever
Quite new to functional languages, but I'm maintaining someone else's code with a lot
I'm quite new to vim. I'm trying tuning vim up by following a book
Quite new to maven here so let me explain first what I am trying
Hi I am quite new to php but i have been following some tutorials
I'm quite new to c++, but I've got the hang of the fundamentals. I've
I'm quite new to CSS and I'm trying to get a page up and
I'm trying to patch up a new vim syntax file for some custom format
I'm a pretty new Vim user and I've found that its learning curve is
Iam quite new to Google chart API's and I am trying to integrate it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.