How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask ATLProg Your Own Question

ATLProg
ATLProg, Software Engineer
Category: Homework
Satisfied Customers: 9151
Experience:  Expert in Java C++ C C# VB Javascript Design SQL HTML
44910485
Type Your Homework Question Here...
ATLProg is online now
A new question is answered every 9 seconds

Need help with Syntax errors on my Retail Calculator. Main.class

This answer was rated:

Need help with Syntax errors on my Retail Calculator. Main.class and jframe issues to fix. Very simple.

Hello Welcome. Thank you for your question, I’m ATLProg and I’ll try to help you.

 

Can you please go to www.wikisend.com and upload your file ? Once you do that you will get a page that has the "File ID" and "Download Link". Copy the "Download Link" or "File ID" and please paste it in your reply here.

 

Customer: replied 3 years ago.

http://wikisend.com/download/949492/RetailCalculator.java


RetailCalculator.java

Please download solution from

http://wikisend.com/download/981264/RetailCalculator.java

I hope i was able to assist you. If you are happy with my service please rate my service . If your are not 100% satisfied, please reply to me so that i can help you better. Please start your question with "For ATLProg only" to request me again
Customer: replied 3 years ago.

hi, i uploaded the file you said you fixed and its the same, I dont see any changes and I still am getting "no main classes found"

There was an extra bracket at the end.
If you want i can put this code in netbeans and send it to you
Customer: replied 3 years ago.

What I did was copy and paste the whole file you sent back into Netbeans. I basically took out what I had and pasted what you gave back and I still get the main class error. So if doing it in Netbeans will make it work, then okay.


Am I doing this right by copy and pasting the code?


let me know that too

It should have worked
Please find solution below

http://wikisend.com/download/732484/RetailApp.zip

http://wikisend.com/download/677160/HowTo_Open_NetBeans_Project.doc
Customer: replied 3 years ago.

okay. Let me try your instructions but another question before I try.


 


I use the new .java file you sent and open the file in NetBeans as instructed.


Then I should have a calculator that works.


 


So by copy and pasting the code from notepad is not the correct way for the file to "work correctly". Right?


I know copy and paste from Word is not good as I went through that mess. Am I correct? Let me know and I will see your answer as I am trying your instructions so give me a few minutes please.


Stay tuned.


Thank You

I better to do development in some IDE like netbeans or eclipse then Notepad to avoid such issues
Customer: replied 3 years ago.

Hi, thanks for waiting.


So I did as you instructed.


First how do I save it if I already have a file called RetailCalculator.java.


So I will have to erase mine and then use this one as the name is important.


Next, there are two "errors" that are probably inter related.


First line 21 has a syntax error that says "Class RetailCalculator is public and should be declared.


Next is the "error" from the output screen.


run:
java.lang.UnsupportedClassVersionError: retailcalculator/RetailCalculator : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: retailcalculator.RetailCalculator. Program will exit.
Exception in thread "main" Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)


Let me know


 

Try this..

1. Right click on RetailApp in Netbeans and select "Run"

If that doesnt work Please send me a snapshot of your netbeans should project layout
Customer: replied 3 years ago.

Same error, I have attached a word doc with screen shot. I believe it is same error

Attachment: 2013-09-25_023337_same_error_and_screen_shot.docx

What is RetailCalculator1.java? It wasnt part of project i sent please remove that infact delete the complete project and try and reopen the project i sent
Customer: replied 3 years ago.

Will do

Customer: replied 3 years ago.

I got the same error. See below.


Also, how do I save it as RetailCalculator? Netbeans is saying there is something else named that and I thought I erased it already.


 


run:
java.lang.UnsupportedClassVersionError: retailcalculator/RetailCalculator : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: retailcalculator.RetailCalculator. Program will exit.
Exception in thread "main" Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)

this is taking too much time my friend now
Please all RetailCalculator projects you may have and use just the one i sent.
And if that doesnt work please send me snapshot
Customer: replied 3 years ago.

okay I will again


Attachment: 2013-09-25_025510_same_error_and_screen_shot_v2.docx


screen shot attached

Do this first do
1. Right click on project and select "Build" and then do "Run"
Customer: replied 3 years ago.

I did what you said but dont I need to save it first before I build it?


I did the clean and build as that was my only choice


I have attached another word doc with a screen shot as you like


take a look

Attachment: 2013-09-25_030114_same_error_and_screen_shot_v3.docx

attached!

i am not sure why you are getting that..looks like you are using a jdk version other than 1.7.
Can you create a new Netbeans project and add RetailCalculator.java in retailcalculator package
Customer: replied 3 years ago.

IT WORKS IT WORKS IT WORKS.


Lets get done with our transaction. OMG it works!!

good..remember to look me up next time :) Please start your question with "For ATLProg only" to request me again
Customer: replied 3 years ago.

I will, I have seen you before.


One quick question. Can you give me the line number or numbers you fixed so I can see and take note!!


Then I am good. as I have to point out what was added/fixed.


Thank You again.

you program was perfect except that it had an extra ending brace at the end
Customer: replied 3 years ago.

are you kidding me UGH really


Well I have to say I learned a lot I did not know about NetBeans and so got training on that and this wasnt a total bust.


Thanks again.


so what are next steps?

THIS ANSWER IS LOCKED!

You need to spend $3 to view this post. Add Funds to your account and buy credits.
ATLProg and other Homework Specialists are ready to help you