И так есть код:точнее его кусочек писанный на C++
cout << "Enter Path of downloaded JRE or JDK: " ;
string JrePath;
cin >>JrePath;
system("update-alternatives --install /usr/bin/java java " << JrePath.c_str() << " 3");
system("update-alternatives --configure java");
if (boost::filesystem::exists("/usr/bin/java/bin/java") == 0)
{
cout << "Java hasn't configured! Path /usr/bin/java/bin/java hasn't exists" << endl;
cout << "Enter Command: ";
cin >> a;
}
main.cpp:36: error: invalid operands of types ‘const char [50]’ and ‘const char*’ to binary ‘operator<<’
main.cpp:49: error: jump to case label
main.cpp:34: error: crosses initialization of ‘std::string JrePath’
main.cpp:54: error: jump to case label
main.cpp:34: error: crosses initialization of ‘std::string JrePath’
main.cpp:27: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result
main.cpp:37: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result
main.cpp:55: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result
Много каких решений перепробовал, ничего не помогает. Прошу помощи.