Skip to main content

Editor does not contain a main type

If you get an error "editor doesn't contain a main type" in eclipse,
solution is :
1) Make sure eclipse created the project as Java project.
2) Just create a new Java project and copy your class into the src folder by import the eventual dependencies and adding all the jar files to it.

This should fix the problem.

Comments

  1. i created a folder in a project and tried to test method overloading with methods kept in test2 class and main in test1 class and created test2 object in test 1 class it was saying

    editor doesn't contain a main type

    but if i paste in the SRC its working why what was the prob

    ReplyDelete
  2. It works fine with SRC because all the java files are placed in it, means all the source files are contained in it and as you know "main" is entry point for every program. So, it looks for main at first glance. "SRC" is the by default directory of the project folder to store all the raw files.

    ReplyDelete

Post a Comment

Popular posts from this blog

Filter packets through jpcap

//Open an interface with openDevice(NetworkInterface intrface, int snaplen, boolean promics, int to_ms) JpcapCaptor captor=JpcapCaptor.openDevice(devices[index], 65535, false, 20); captor.setFilter("tcp && src port 6000", true); It'll filter all the TCP packets with source port number 6000. So, all we need to do is pass the parameters and use logical and, or operators.

VBA MAcro to generate "table of contents with hyperlinks" automatically in a ppt

VBA MAcro to generate "table of contents with hyperlinks" automatically in a ppt: Function TableOfContent(count As Integer) 'count is the no. of slides in ppt Dim var As Integer Dim i As Integer, scount As Integer Dim strSel As String, strTitle As String, strb As String, strtemp As String, str As String Dim arr() As String Dim index As Integer, indexcount As Integer, slidecount As Integer Dim summary As Slide Dim para As Integer Dim slideOrder() As Integer 'To generate the Table of contents slide ReDim slideOrder(count - 2) 'Collect all the IDs of the selected slides For i = 1 To count - 2 slideOrder(i) = i + 2 Next 'Iterate over the slides in Index order slidecount = UBound(slideOrder) For scount = 1 To slidecount If ActivePresentation.Slides(slideOrder(scount)).Shapes.HasTitle Then 'Build up the ToC Text strTitle = ActivePresentation.Slides(slideOrder(scount)).Shapes("UseCase").TextFrame.TextRange.Text + ": &qu

How to do mass insert in redis

A basic and fairly easy way to do mass insert in redis : Command to use: echo -e "$(cat redis_mass_insert.txt)" | redis-cli --pipe Content of file "redis_mass_insert.txt": *3\r\n$5\r\nlpush\r\n$5\r\nu:m:1\r\n$5\r\nvalu1\r\n*3\r\n$5\r\nlpush\r\n$5\r\nu:m:1\r\n$7\r\nmyvalue\r\n Result: All data transferred. Waiting for the last reply... ERR unknown command ' *2' ERR unknown command '$4' ERR wrong number of arguments for 'echo' command ERR unknown command '$20' ERR unknown command ' A�j d�Q;yT��าก �h>' NOTE: command line will show error but in actual the data is transferred and you can check it by entering in redis. Here's the snapshot of the whole procedure: To check how the command is responding: use hexdump -C Command: echo -n $'$3\r\nset\r\n$3\r\nkey\r\n$5\r\nvalue\r\n ' | hexdump -C whose output will be something like 00000000 24 33 0d 0a 73 65 74 0d 0a 24 33 0d 0a 6b 65 79 |$3..set..