Not simple - How to package Java class in the Eclipse?
Posted on 2004-09-07
I know it is a simple question - I cannot figure it out, please help me. I create a Eclipse project for my regular Java class development. I want my classes to be packaged in a JAR file. Thus I create a directory hierarchy and let the Eclipse create a class for me like this (I set the package name as myTest.src when creating the class):
public class Test
// TODO Auto-generated constructor stub
public static void main(String args)
However, The Eclipse complains "The declared package does not match the expected package". The class is created by the Eclipse and the package code is made by the Eclipse too. Why it is still complaining? I tried to package the class to single level such as package myTest. It works.
It seems there is a trick to package java classes in multi-level with the Eclipse. Could anyone tell me how to do it?