Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here is my code, and below are my errors. Can you please help me debug? I am currently running in NetBeans. package TestProjectWeek3; public class

Here is my code, and below are my errors. Can you please help me debug? I am currently running in NetBeans.

package TestProjectWeek3;

public class TestProjectWeek3 {

public static void main(String[] args) { System.out.println("Caesar Cipher Implementation"); int key=0; String text=""; while(true) { text=""; try { System.out.println("Enter the key and text seperated by space: "); String[] s = in.nextLine().trim().split(" "); key = Integer.parselnt(s[0]); for(int i=1;i3 ||key<-3) break; String encryptedText= translate(text,key); System.out.println("Encrypted Text: "+encryptedText); } catch(NumberFormatException e){ System.out.println("ERROR: Key is not an Integer."); } } in.close(); } public static string translate(String inText, int key) { string outText=""; for(int i=0;i

Errors--

java.lang.NoClassDefFoundError: string at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.privateGetMethodRecursive(Class.java:3048) at java.lang.Class.getMethod0(Class.java:3018) at java.lang.Class.getMethod(Class.java:1784) at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526) Caused by: java.lang.ClassNotFoundException: string at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 7 more Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" C:\Users\blink\AppData\Local\NetBeans\Cache\8.2\executor-snippets un.xml:53: Java returned: 1 BUILD FAILED (total time: 0 seconds)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions

Question

=+2 Why did OBI create Centers of Excellence?

Answered: 1 week ago

Question

=+professionalism and competency in handling global HR issues?

Answered: 1 week ago