• Register
search
Log In
0 votes
50 views

Problem :

I am having a problem importing classes and setting variables and I need help with it.
I am getting below error

exception in thread "main" java.lang.error: unresolved compilation problem:

6.9k points

1 Answer

0 votes

Solution :

This line is the root cause of your problem: Message messageObject = new Message ();


The error says that Message class is not known at compile time.

So you need to import below classes to resolve the issue.

import package1.package2.Message;

import java.util.Scanner; 

import java.util.Timer;

Further Readings:

http://docs.oracle.com/javase/tutorial/java/package/usepkgs.html

36.1k points
edited by

Related questions

0 votes
2 answers 407 views
407 views
Problem : I am having a trouble while importing classes and setting variables and also I need help with my test program which I am doing. I want to test a program that simply outputs what the input was and puts the time stamp ( like Skype does ). I am having ... Message cannot be resolved to a type Message cannot be resolved to a type The constructor Time() is undefined at MyTest.main(Test.java:8)
asked Jan 28 jwilliam 3.9k points
1 vote
1 answer 17 views
17 views
Problem: I am a begginer in java programming language and I have been coding for just some days. To practice my programming I wrote this code in java: public class Main { public static void main(String[] argv){ int 2count, h-l, a/b, } } But It shows me the error message ... , . expected Syntax error on token ",", ;expected at Main.main(Main.java:3) Whats is wrong in my code can anyone help me out?
asked Apr 6 LizzyM 5.7k points
1 vote
1 answer 22 views
22 views
Problem: I got error while applying weblogic patch useing bsu.sh: patch_download_dir=$FMW_HOME/utils/bsu/cache_dir -patchlist=GFWX -prod_dir=$FMW_HOME/wlserver_10.3 -log=$FMW_HOME/utils/bsu/bsu_weblogic.log Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded ... .bea.plateng.patch.Patch.main(Patch.java:281) Can anyone explain me this and help me to solve this error?
asked Mar 27 LizzyM 5.7k points
1 vote
1 answer 16 views
16 views
Problem : I have very recently started to learn programming in Java. I am trying to execute my java code but I am facing the below error. “Exception in thread "main" java.lang.arrayindexoutofboundsexception:” I am unable to understand above error. Please find below my code: ... according to my debugger*/ myodd[j] = input[i]; j++; } return myodd; } Please help me in fixing above error.
asked Mar 30 morrisBson 3.2k points
0 votes
1 answer 70 views
70 views
I wrote a java code that gives some error: Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException at org.hibernate.boot.spi.XmlMappingBinderAccess.<init>(XmlMappingBinderAccess.java:43) at org.hibernate.boot.MetadataSources.< ... .initializeBean(AbstractAutowireCapableBeanFactory.java:1700) ... 25 common frames omitted Can anyone help me out with this?
asked Mar 12 LizzyM 5.7k points